Browse Source

Make `ILVariableEqualityComparer.GetHashCode` structurally more similar to the Equals implementation

pull/3111/head
Daniel Grunwald 2 years ago
parent
commit
ea5adf8e01
  1. 6
      ICSharpCode.Decompiler/IL/ILVariable.cs

6
ICSharpCode.Decompiler/IL/ILVariable.cs

@ -654,11 +654,11 @@ namespace ICSharpCode.Decompiler.IL @@ -654,11 +654,11 @@ namespace ICSharpCode.Decompiler.IL
{
if (obj.Kind is VariableKind.StackSlot or VariableKind.PatternLocal)
return obj.GetHashCode();
if (obj.Index == null && obj.StateMachineField == null)
return obj.GetHashCode();
if (obj.Index != null)
return (obj.Function, obj.Kind, obj.Index).GetHashCode();
return (obj.Function, obj.Kind, obj.StateMachineField).GetHashCode();
if (obj.StateMachineField != null)
return (obj.Function, obj.Kind, obj.StateMachineField).GetHashCode();
return obj.GetHashCode();
}
}
}

Loading…
Cancel
Save