This is a work in progress just to show the issue/possible solution and start a discussion. No test, no snapshots yet.
Currently, the == operators call the static object.Equals method that operates on object parameters. This induces boxing (in case the value object is a struct) and can be avoided since the the value object already defines correctly typed Equals methods. Subsequently, this PR also changes the == operator implementation when comparison is done with an underlying type and establishes symmetry for the != operators, ie. x != y should just be !(x == y).
This is a work in progress just to show the issue/possible solution and start a discussion. No test, no snapshots yet.
Currently, the
==
operators call the staticobject.Equals
method that operates onobject
parameters. This induces boxing (in case the value object is a struct) and can be avoided since the the value object already defines correctly typedEquals
methods. Subsequently, this PR also changes the==
operator implementation when comparison is done with an underlying type and establishes symmetry for the!=
operators, ie.x != y
should just be!(x == y)
.