summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorAlex Cruise <alex@cluonflux.com>2009-04-14 01:08:36 +0000
committerAlex Cruise <alex@cluonflux.com>2009-04-14 01:08:36 +0000
commitd237da1fff2aeaf8544d5937b514b96e5417fb27 (patch)
treeb76543a96fded6a6fc131e8da034d4e4bc0684f7 /src/library
parente1ccc2e82996b7d1c28fcca330387ad687cff6b5 (diff)
downloadscala-d237da1fff2aeaf8544d5937b514b96e5417fb27.tar.gz
scala-d237da1fff2aeaf8544d5937b514b96e5417fb27.tar.bz2
scala-d237da1fff2aeaf8544d5937b514b96e5417fb27.zip
Bug 777: Applied Jamie's patch
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/xml/Utility.scala11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/library/scala/xml/Utility.scala b/src/library/scala/xml/Utility.scala
index 3c8a3e6cbd..bba4d926c1 100644
--- a/src/library/scala/xml/Utility.scala
+++ b/src/library/scala/xml/Utility.scala
@@ -255,13 +255,18 @@ object Utility extends AnyRef with parsing.TokenTests {
* @param attribHashCode
* @param children
*/
- def hashCode(pre: String, label: String, attribHashCode: Int, scpeHash: Int, children: Seq[Node]) = {
+ def hashCode(pre: String, label: String, attribHashCode: Int, scpeHash: Int, children: Seq[Node]) = (
( if(pre ne null) {41 * pre.hashCode() % 7} else {0})
+ label.hashCode() * 53
+ attribHashCode * 7
+ scpeHash * 31
- + children.hashCode()
- }
+ + {
+ var c = 0
+ val i = children.elements
+ while(i.hasNext) c = c * 41 + i.next.hashCode
+ c
+ }
+ )
/**
* Returns a hashcode for the given constituents of a node