forked from jasder/antlr
[Swift] Remove Triple.swift.
This is not in use. It never has been, as far as I can see.
This commit is contained in:
parent
b4c34da1f0
commit
19c0ecaedf
|
@ -1,38 +0,0 @@
|
||||||
///
|
|
||||||
/// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
|
||||||
/// Use of this file is governed by the BSD 3-clause license that
|
|
||||||
/// can be found in the LICENSE.txt file in the project root.
|
|
||||||
///
|
|
||||||
|
|
||||||
|
|
||||||
public class Triple<A:Hashable, B:Hashable, C:Hashable>: Hashable, CustomStringConvertible {
|
|
||||||
public let a: A
|
|
||||||
public let b: B
|
|
||||||
public let c: C
|
|
||||||
|
|
||||||
public init(_ a: A, _ b: B, _ c: C) {
|
|
||||||
self.a = a
|
|
||||||
self.b = b
|
|
||||||
self.c = c
|
|
||||||
}
|
|
||||||
public var hashValue: Int {
|
|
||||||
var hash = MurmurHash.initialize()
|
|
||||||
hash = MurmurHash.update(hash, a)
|
|
||||||
hash = MurmurHash.update(hash, b)
|
|
||||||
hash = MurmurHash.update(hash, c)
|
|
||||||
return MurmurHash.finish(hash, 3)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public var description: String {
|
|
||||||
return "\(a),\(b),(c)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public func ==<A, B, C>(lhs: Triple<A, B, C>, rhs: Triple<A, B, C>) -> Bool {
|
|
||||||
if lhs === rhs {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
// return false
|
|
||||||
return lhs.a == rhs.a && lhs.b == rhs.b && lhs.c == rhs.c
|
|
||||||
}
|
|
Loading…
Reference in New Issue