Explorar o código

avoid an enet_time_get call when timeout expires

lsalzman %!s(int64=11) %!d(string=hai) anos
pai
achega
5721b667f2
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      protocol.c

+ 3 - 0
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 ();