Skip to content

Instantly share code, notes, and snippets.

@okomok
Created February 4, 2009 18:17
Show Gist options
  • Save okomok/58249 to your computer and use it in GitHub Desktop.
Save okomok/58249 to your computer and use it in GitHub Desktop.
rejected triple key
private[mada] case class TripleKey[A](v: Vector[A], start: Int, end: Int) {
override def equals(that: Any) = that match {
case that: TripleKey[_] => (v eq that.v) && (start == that.start) && (end == that.end)
case _ => false
}
override def hashCode = {
HashCode.ofRef(v) + HashCode.ofInt(start) * 7 + HashCode.ofInt(end) * 41
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment