aboutsummaryrefslogtreecommitdiffhomepage
path: root/protocol.c
diff options
context:
space:
mode:
authorlsalzman <[email protected]>2014-02-21 11:20:20 +0200
committerlsalzman <[email protected]>2014-02-21 11:20:20 +0200
commit5721b667f2d57d1c8b65ef5575379f6756ec2938 (patch)
tree214bd3f00ccdf3a1dc92077ab196ba18ce9cf973 /protocol.c
parentc58ec4cc448ccdc933d53241ce14a61a020140c7 (diff)
downloadenet-5721b667f2d57d1c8b65ef5575379f6756ec2938.tar.gz
enet-5721b667f2d57d1c8b65ef5575379f6756ec2938.zip
avoid an enet_time_get call when timeout expires
Diffstat (limited to 'protocol.c')
-rw-r--r--protocol.c3
1 files changed, 3 insertions, 0 deletions
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 ();