summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/Set.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-01-25 19:41:34 +0000
committerPaul Phillips <paulp@improving.org>2011-01-25 19:41:34 +0000
commit5f905da8b66fe69b09d8b62c917970cde14e23ba (patch)
treec1670e8ca407b3e3f8a17fc6c42a87364cbd64e9 /src/library/scala/collection/Set.scala
parentdea65103bf06c0a91527692ac053d0d2cb9a9ddd (diff)
downloadscala-5f905da8b66fe69b09d8b62c917970cde14e23ba.tar.gz
scala-5f905da8b66fe69b09d8b62c917970cde14e23ba.tar.bz2
scala-5f905da8b66fe69b09d8b62c917970cde14e23ba.zip
A new murmur3 hashcode implementation contribut...
A new murmur3 hashcode implementation contributed by rex kerr. I'm really happy with it. There is benchmarking code included but you can use the pudding for proof: the compiler compiling itself is clearly faster. I deleted the existing murmur2 implementation which has never left trunk in a release. There remain some possible points of improvement with inlining and/or synthetic method generation, but this is a major improvement over the status quo. Closes #2537, review by prokopec.
Diffstat (limited to 'src/library/scala/collection/Set.scala')
-rw-r--r--src/library/scala/collection/Set.scala2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/library/scala/collection/Set.scala b/src/library/scala/collection/Set.scala
index b012836a78..412ebf0e25 100644
--- a/src/library/scala/collection/Set.scala
+++ b/src/library/scala/collection/Set.scala
@@ -36,6 +36,8 @@ trait Set[A] extends (A => Boolean)
* @define Coll Set
*/
object Set extends SetFactory[Set] {
+ private[collection] val hashSeed = "Set".hashCode
+
def newBuilder[A] = immutable.Set.newBuilder[A]
override def empty[A]: Set[A] = immutable.Set.empty[A]
implicit def canBuildFrom[A]: CanBuildFrom[Coll, A, Set[A]] = setCanBuildFrom[A]