Remove manual overflow for JS arithmetic operations

This commit is contained in:
Ilya Gorbunov
2016-12-20 19:01:06 +03:00
parent d3c82a2741
commit 6b509892cb
2 changed files with 1 additions and 2 deletions
@@ -123,7 +123,6 @@ public abstract class AbstractList<out E> protected constructor() : AbstractColl
var hashCode = 1
for (e in c) {
hashCode = 31 * hashCode + (e?.hashCode() ?: 0)
hashCode = hashCode or 0 // make sure we don't overflow
}
return hashCode
}
@@ -30,7 +30,7 @@ public abstract class AbstractSet<out E> protected constructor() : AbstractColle
internal fun unorderedHashCode(c: Collection<*>): Int {
var hashCode = 0
for (element in c) {
hashCode = (hashCode + (element?.hashCode() ?: 0)) or 0
hashCode += (element?.hashCode() ?: 0)
}
return hashCode
}