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
Fixed GetMTU not to generate garbage
This commit is contained in:
@@ -64,11 +64,13 @@ namespace Lidgren.Network
|
||||
|
||||
internal int GetMTU(IList<NetConnection> recipients)
|
||||
{
|
||||
NetException.Assert(recipients.Count > 0);
|
||||
int count = recipients.Count;
|
||||
NetException.Assert(count > 0);
|
||||
|
||||
int mtu = int.MaxValue;
|
||||
foreach (NetConnection conn in recipients)
|
||||
for(int i=0;i<count;i++)
|
||||
{
|
||||
var conn = recipients[i];
|
||||
int cmtu = conn.m_currentMTU;
|
||||
if (cmtu < mtu)
|
||||
mtu = cmtu;
|
||||
|
||||
Reference in New Issue
Block a user