Skip to content

Commit

Permalink
Refactor ObjectType's Equatable implementation to be a static method
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrubin committed Apr 12, 2019
1 parent e41b2f9 commit c452b80
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions SwiftGit2/Objects.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ public protocol ObjectType {
init(_ pointer: OpaquePointer)
}

public func == <O: ObjectType>(lhs: O, rhs: O) -> Bool {
return lhs.oid == rhs.oid
}

public extension ObjectType {
static func == (lhs: Self, rhs: Self) -> Bool {
return lhs.oid == rhs.oid
}

func hash(into hasher: inout Hasher) {
hasher.combine(oid)
}
Expand Down

0 comments on commit c452b80

Please sign in to comment.