Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0513f7d

Browse files
Fixed Conformance to Hashable Protocol in Vertex and Edge structs
1 parent 73f0092 commit 0513f7d

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

‎Graph/Graph/Edge.swift‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ extension Edge: CustomStringConvertible {
2929

3030
extension Edge: Hashable {
3131

32+
3233
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-
}
34+
hasher.combine(from)
35+
hasher.combine(to)
36+
if weight != nil {
37+
hasher.combine(weight)
38+
}
39+
}
40+
3941
}
4042

4143
public func == <T>(lhs: Edge<T>, rhs: Edge<T>) -> Bool {

‎Graph/Graph/Vertex.swift‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ extension Vertex: CustomStringConvertible {
2424

2525
extension Vertex: Hashable {
2626

27-
public func hasher(into hasher: inout Hasher){
28-
29-
hasher.combine(data)
30-
hasher.combine(index)
31-
}
27+
28+
29+
public func hasher(into hasher: inout Hasher){
30+
31+
hasher.combine(data)
32+
hasher.combine(index)
33+
}
3234

3335
}
3436

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /