Skip to content

Commit

Permalink
Adjust NestedAttributesEqual to perform shallow compare first (#762)
Browse files Browse the repository at this point in the history
  • Loading branch information
austinvalle authored Jun 13, 2023
1 parent 8cfc161 commit 1d1bf84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/fwschema/nested_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ type NestedAttribute interface {
// NestedAttribute. NestedAttribute Equal implementations should still compare
// the concrete types in addition to using this helper.
func NestedAttributesEqual(a, b NestedAttribute) bool {
if a.GetNestingMode() != b.GetNestingMode() {
if !AttributesEqual(a, b) {
return false
}

if !a.GetNestedObject().Equal(b.GetNestedObject()) {
if a.GetNestingMode() != b.GetNestingMode() {
return false
}

return AttributesEqual(a, b)
return a.GetNestedObject().Equal(b.GetNestedObject())
}

0 comments on commit 1d1bf84

Please sign in to comment.