File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -29,12 +29,10 @@ extension Edge: CustomStringConvertible {
29
29
30
30
extension Edge : Hashable {
31
31
32
- public var hashValue : Int {
33
- var string = " \( from. description) \( to. description) "
34
- if weight != nil {
35
- string. append ( " \( weight!) " )
36
- }
37
- return string. hashValue
32
+ public func hash( into hasher: inout Hasher ) {
33
+ hasher. combine ( from. description)
34
+ hasher. combine ( to. description)
35
+ hasher. combine ( weight)
38
36
}
39
37
}
40
38
Original file line number Diff line number Diff line change @@ -24,8 +24,9 @@ extension Vertex: CustomStringConvertible {
24
24
25
25
extension Vertex : Hashable {
26
26
27
- public var hashValue : Int {
28
- return " \( data) \( index) " . hashValue
27
+ public func hash( into hasher: inout Hasher ) {
28
+ hasher. combine ( data)
29
+ hasher. combine ( index)
29
30
}
30
31
31
32
}
You can’t perform that action at this time.
0 commit comments