summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/collection/immutable/Map.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/sources/scala/collection/immutable/Map.scala b/sources/scala/collection/immutable/Map.scala
index 0dd67df7b1..e5874141e6 100644
--- a/sources/scala/collection/immutable/Map.scala
+++ b/sources/scala/collection/immutable/Map.scala
@@ -146,12 +146,16 @@ trait Map[A, B] with scala.collection.Map[A, B] {
} else
false;
+ override def hashCode() = {
+ elements.foldLeft(0)((hash:Int,E:Object) => hash + E.hashCode());
+ }
+
/** This method controls how a mapping is represented in the string
* representation provided by method <code>toString</code>.
*/
def mappingToString(p: Pair[A, B]) = p._1.toString() + " -> " + p._2;
class MapTo(key: A) {
- def ->(value: B): Map[A, B] = update(key, value);
+ def ->(value: B) = update(key, value);
}
}