You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-15 14:46:29 +09:00
Optimized ReduceStoragePool ever so slightly
This commit is contained in:
@@ -189,12 +189,15 @@ namespace Lidgren.Network
|
||||
wasStoredBytes = m_storedBytes;
|
||||
reduceTo = m_maxStoredBytes / 2;
|
||||
|
||||
int remove = 0;
|
||||
while (m_storedBytes > reduceTo && m_storagePool.Count > 0)
|
||||
{
|
||||
byte[] arr = m_storagePool[0];
|
||||
m_storedBytes -= arr.Length;
|
||||
m_storagePool.RemoveAt(0);
|
||||
remove++;
|
||||
}
|
||||
if (remove > 0)
|
||||
m_storagePool.RemoveRange(0, remove);
|
||||
}
|
||||
|
||||
// done
|
||||
|
||||
Reference in New Issue
Block a user