Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
perf(networked-vars): Skip NetworkList set operation when value uncha…
…nged

Added equality check in NetworkList indexer setter to avoid unnecessary operations when the new value equals the existing value. This improves performance by preventing redundant list events and network synchronization.
  • Loading branch information
harayuu9 committed Aug 6, 2025
commit 0d80039041d477f9865f5f9f65c601eb8c708a67
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,13 @@ public T this[int index]
}

var previousValue = m_List[index];

// Compare the Value being applied to the current value
if (NetworkVariableSerialization<T>.AreEqual(ref previousValue, ref value))
{
return;
}

m_List[index] = value;

var listEvent = new NetworkListEvent<T>()
Expand Down