Merge pull request #235 from gemiren/master

Provide func ==() since we override hash()
This commit is contained in:
Nabil Chatbi 2023-01-10 14:24:09 +01:00 committed by GitHub
commit fcf73c1aa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -1301,6 +1301,14 @@ open class Element: Node {
return super.copy(clone: clone, parent: parent)
}
public static func ==(lhs: Element, rhs: Element) -> Bool {
guard lhs as Node == rhs as Node else {
return false
}
return lhs._tag == rhs._tag
}
override public func hash(into hasher: inout Hasher) {
super.hash(into: &hasher)
hasher.combine(_tag)