Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions Graph/Graph/Edge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ extension Edge: CustomStringConvertible {

extension Edge: Hashable {

public func hash(into hasher: inout Hasher) {
hasher.combine(from.description)
hasher.combine(to.description)
hasher.combine(weight)
}
public func hash(into hasher: inout Hasher) {
hasher.combine(from)
hasher.combine(to)
if weight != nil {
hasher.combine(weight)
}
}


}

public func == <T>(lhs: Edge<T>, rhs: Edge<T>) -> Bool {
Expand Down
14 changes: 10 additions & 4 deletions Graph/Graph/Vertex.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@ extension Vertex: CustomStringConvertible {

extension Vertex: Hashable {

public func hash(into hasher: inout Hasher) {
hasher.combine(data)
hasher.combine(index)
}



public func hasher(into hasher: inout Hasher){

hasher.combine(data)
hasher.combine(index)
}



}

Expand Down