소스 검색

avoid an enet_time_get call when timeout expires

lsalzman 11 년 전
부모
커밋
5721b667f2
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  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 ();