diff options
author | eihrul <eihrul> | 2010-05-13 16:55:59 +0000 |
---|---|---|
committer | eihrul <eihrul> | 2010-05-13 16:55:59 +0000 |
commit | 29cbf82230087db1bd16884617754dbee23e4534 (patch) | |
tree | 90722aa0d50f789f4efe158e2fd110f3d10ec523 /host.c | |
parent | 2f19182e58b0abf67c3406a4ac6c546903f5c178 (diff) | |
download | enet-29cbf82230087db1bd16884617754dbee23e4534.tar.gz enet-29cbf82230087db1bd16884617754dbee23e4534.zip |
use dispatch queues to cut down on array crawling costs
Diffstat (limited to 'host.c')
-rw-r--r-- | host.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -72,13 +72,14 @@ enet_host_create (const ENetAddress * address, size_t peerCount, enet_uint32 inc host -> recalculateBandwidthLimits = 0; host -> mtu = ENET_HOST_DEFAULT_MTU; host -> peerCount = peerCount; - host -> lastServicedPeer = host -> peers; host -> commandCount = 0; host -> bufferCount = 0; host -> receivedAddress.host = ENET_HOST_ANY; host -> receivedAddress.port = 0; host -> receivedDataLength = 0; + enet_list_clear (& host -> dispatchQueue); + for (currentPeer = host -> peers; currentPeer < & host -> peers [host -> peerCount]; ++ currentPeer) @@ -92,6 +93,7 @@ enet_host_create (const ENetAddress * address, size_t peerCount, enet_uint32 inc enet_list_clear (& currentPeer -> sentUnreliableCommands); enet_list_clear (& currentPeer -> outgoingReliableCommands); enet_list_clear (& currentPeer -> outgoingUnreliableCommands); + enet_list_clear (& currentPeer -> dispatchedCommands); enet_peer_reset (currentPeer); } |