Replaced LINQ Dirty field counting code as it allocates garbage (?!?!)
This commit is contained in:
parent
1d4cb9a347
commit
f2c3662f63
@ -462,7 +462,13 @@ namespace MLAPI.MonoBehaviours.Core
|
|||||||
SetDirtyness();
|
SetDirtyness();
|
||||||
if(Time.time - lastSyncTime >= SyncVarSyncDelay)
|
if(Time.time - lastSyncTime >= SyncVarSyncDelay)
|
||||||
{
|
{
|
||||||
byte dirtyCount = (byte)dirtyFields.Count(x => x == true);
|
byte dirtyCount = 0;
|
||||||
|
for (byte i = 0; i < dirtyFields.Length; i++)
|
||||||
|
{
|
||||||
|
if (dirtyFields[i])
|
||||||
|
dirtyCount++;
|
||||||
|
}
|
||||||
|
|
||||||
if (dirtyCount == 0)
|
if (dirtyCount == 0)
|
||||||
return; //All up to date!
|
return; //All up to date!
|
||||||
//It's sync time!
|
//It's sync time!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user