mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
perf: remove syncvar boxing (#927)
This commit is contained in:
parent
9e911b9d5e
commit
b2ba5896fa
@ -423,8 +423,7 @@ protected NetworkIdentity GetSyncVarNetworkIdentity(uint netId, ref NetworkIdent
|
||||
protected void SetSyncVar<T>(T value, ref T fieldValue, ulong dirtyBit)
|
||||
{
|
||||
// newly initialized or changed value?
|
||||
if ((value == null && fieldValue != null) ||
|
||||
(value != null && !value.Equals(fieldValue)))
|
||||
if (!EqualityComparer<T>.Default.Equals(value, fieldValue))
|
||||
{
|
||||
if (LogFilter.Debug) Debug.Log("SetSyncVar " + GetType().Name + " bit [" + dirtyBit + "] " + fieldValue + "->" + value);
|
||||
SetDirtyBit(dirtyBit);
|
||||
|
Loading…
Reference in New Issue
Block a user