Skip to content

Commit

Permalink
chore: minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbee committed Apr 10, 2024
1 parent e2b7168 commit 52aa9fb
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pkg/patch/myers.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,12 @@ func equalLeafs(a, b *etree.Element) bool {
return true
}

// sameElements return true same tag and if id exists and are equal
// sameElements checks if same tag and equal id attributes
func sameElements(e1 *etree.Element, e2 *etree.Element) bool {
if e1.Tag != e2.Tag {
return false
}
id1 := getAttrValue(e1, "id")
id2 := getAttrValue(e2, "id")
if id1 != "" || id2 != "" {
return id1 == id2
}
return true
return id1 == id2
}

0 comments on commit 52aa9fb

Please sign in to comment.