Skip to content

Commit

Permalink
Merge pull request #240 from apelisse/equalsusing-in-compare
Browse files Browse the repository at this point in the history
Use EqualsUsing in Typed.Compare()
  • Loading branch information
k8s-ci-robot authored Jun 27, 2023
2 parents fa1e46d + 6e15532 commit ab402c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion typed/typed.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,13 @@ func (tv TypedValue) Compare(rhs *TypedValue) (c *Comparison, err error) {
Modified: fieldpath.NewSet(),
Added: fieldpath.NewSet(),
}
a := value.NewFreelistAllocator()
_, err = merge(&tv, rhs, func(w *mergingWalker) {
if w.lhs == nil {
c.Added.Insert(w.path)
} else if w.rhs == nil {
c.Removed.Insert(w.path)
} else if !value.Equals(w.rhs, w.lhs) {
} else if !value.EqualsUsing(a, w.rhs, w.lhs) {
// TODO: Equality is not sufficient for this.
// Need to implement equality check on the value type.
c.Modified.Insert(w.path)
Expand Down

0 comments on commit ab402c1

Please sign in to comment.