Remove List.ForEach on hot path. (#467)

* Remove LINQ on hot path.

* Fixed erroneous classification of List.ForEach as LINQ.

* Added back using so that it could be removed by #452.
This commit is contained in:
rodolphito 2019-02-27 06:11:52 -08:00 committed by vis2k
parent d9a64c62b7
commit dbd5f57e96

View File

@ -394,7 +394,13 @@ public void ClearAllDirtyBits()
syncVarDirtyBits = 0L;
// flush all unsynchronized changes in syncobjects
m_SyncObjects.ForEach(obj => obj.Flush());
// note: don't use List.ForEach here, this is a hot path
// List.ForEach: 432b/frame
// for: 231b/frame
for (int i = 0; i < m_SyncObjects.Count; ++i)
{
m_SyncObjects[i].Flush();
}
}
internal bool AnySyncObjectDirty()