mirror of
https://github.com/github/semantic.git
synced 2025-01-02 12:23:08 +03:00
Parameterized Patch hashing.
This commit is contained in:
parent
ca6392e636
commit
ae7f30e922
@ -19,3 +19,15 @@ extension Patch {
|
||||
&& Optional.equals(Fix.equals(param))(left.state.after, right.state.after)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Hashing
|
||||
|
||||
extension Patch {
|
||||
public func hash(param: A -> Hash) -> Hash {
|
||||
return Hash.Ordered([
|
||||
state.before.map { $0.hash(param) } ?? Hash.Empty,
|
||||
state.after.map { $0.hash(param) } ?? Hash.Empty
|
||||
])
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user