lnobad / lidgren-network-gen3

Automatically exported from code.google.com/p/lidgren-network-gen3
0 stars 0 forks source link

Some optimization #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
You can use RemoveRange in NetPeer.ReduceStoragePool instead of RemoveAt(0):

int i = 0;
for( ; i < m_storagePool.Count && m_storedBytes > reduceTo; ++i)
 m_storedBytes -= m_storagePool[i].Length;

m_storagePool.RemoveRange(0, i);

Original issue reported on code.google.com by NN1436401@gmail.com on 21 Sep 2010 at 1:54

GoogleCodeExporter commented 9 years ago
int i = 1;

Otherwise it is not good :)

Original comment by NN1436401@gmail.com on 21 Sep 2010 at 2:13

GoogleCodeExporter commented 9 years ago
An optimization so small, it's just barely worth the risk introducing bugs for 
;-) Added in revision 120.

Original comment by lidg...@gmail.com on 22 Sep 2010 at 8:16