File tree 2 files changed +19
-9
lines changed
2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -29,11 +29,15 @@ extension Edge: CustomStringConvertible {
29
29
30
30
extension Edge : Hashable {
31
31
32
- public func hash( into hasher: inout Hasher ) {
33
- hasher. combine ( from. description)
34
- hasher. combine ( to. description)
35
- hasher. combine ( weight)
36
- }
32
+ public func hash( into hasher: inout Hasher ) {
33
+ hasher. combine ( from)
34
+ hasher. combine ( to)
35
+ if weight != nil {
36
+ hasher. combine ( weight)
37
+ }
38
+ }
39
+
40
+
37
41
}
38
42
39
43
public func == < T> ( lhs: Edge < T > , rhs: Edge < T > ) -> Bool {
Original file line number Diff line number Diff line change @@ -24,10 +24,16 @@ extension Vertex: CustomStringConvertible {
24
24
25
25
extension Vertex : Hashable {
26
26
27
- public func hash( into hasher: inout Hasher ) {
28
- hasher. combine ( data)
29
- hasher. combine ( index)
30
- }
27
+
28
+
29
+
30
+ public func hasher( into hasher: inout Hasher ) {
31
+
32
+ hasher. combine ( data)
33
+ hasher. combine ( index)
34
+ }
35
+
36
+
31
37
32
38
}
33
39
You can’t perform that action at this time.
0 commit comments