Skip to content

Commit

Permalink
[WIP] Don't call object.Equals() from '=='-operators but use Equals i…
Browse files Browse the repository at this point in the history
…mplementations on the type.
  • Loading branch information
danielcweber committed Aug 14, 2024
1 parent 88f00f3 commit 2b082e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Vogen/Generators/StructGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public readonly {itemUnderlyingType} Value
}}
{GenerateEqualsMethodsAndOperators.GenerateEqualsMethodsForAStruct(item, tds)}
public static global::System.Boolean operator ==({structName} left, {structName} right) => Equals(left, right);
public static global::System.Boolean operator ==({structName} left, {structName} right) => left.Equals(right);
public static global::System.Boolean operator !=({structName} left, {structName} right) => !(left == right);
{GenerateEqualsMethodsAndOperators.GenerateEqualsOperatorsForPrimitivesIfNeeded(itemUnderlyingType, structName, item)}
Expand Down

0 comments on commit 2b082e3

Please sign in to comment.