From 5721b667f2d57d1c8b65ef5575379f6756ec2938 Mon Sep 17 00:00:00 2001 From: lsalzman Date: Fri, 21 Feb 2014 11:20:20 +0200 Subject: [PATCH] avoid an enet_time_get call when timeout expires --- protocol.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protocol.c b/protocol.c index b8d4863..c56d1c8 100644 --- a/protocol.c +++ b/protocol.c @@ -1904,6 +1904,9 @@ enet_host_service (ENetHost * host, ENetEvent * event, enet_uint32 timeout) } } + if (ENET_TIME_GREATER_EQUAL (host -> serviceTime, timeout)) + return 0; + do { host -> serviceTime = enet_time_get ();