Skip to content

Commit e1e76dc

Browse files
Apply suggestion from @EmandM
Co-authored-by: Emma <emma.mcmillan@unity3d.com>
1 parent 392464f commit e1e76dc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviourUpdater.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ internal void AddForUpdate(NetworkObject networkObject)
5151
[MethodImpl(MethodImplOptions.AggressiveInlining)]
5252
internal void ProcessDirtyObjectServer(NetworkObject dirtyObj, bool forceSend)
5353
{
54-
for (int i = 0; i < m_ConnectionManager.ConnectedClientsList.Count; i++)
54+
foreach (var client in m_ConnectionManager.ConnectedClientsList)
5555
{
56-
var client = m_ConnectionManager.ConnectedClientsList[i];
5756
if (m_NetworkManager.DistributedAuthorityMode || dirtyObj.IsNetworkVisibleTo(client.ClientId))
5857
{
5958
// Sync just the variables for just the objects this client sees

0 commit comments

Comments
 (0)