Skip to content

Commit

Permalink
Add conformances to AVLTree
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbean committed Aug 28, 2019
1 parent 77e642e commit d08791c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/DataStructures/AVLTree.swift
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,12 @@ extension AVLTree: ExpressibleByArrayLiteral {
}
}

extension AVLTree.Node: Hashable where Key: Hashable, Value: Hashable {
/// Uses the `ObjectIdentifier` of this `Node` to determine hashing.
public func hash(into hasher: inout Hasher) {
hasher.combine(ObjectIdentifier(self))
}
}

extension AVLTree: Equatable where Value: Equatable { }
extension AVLTree: Hashable where Key: Hashable, Value: Hashable { }

0 comments on commit d08791c

Please sign in to comment.