Remove manual overflow for JS arithmetic operations
This commit is contained in:
@@ -123,7 +123,6 @@ public abstract class AbstractList<out E> protected constructor() : AbstractColl
|
|||||||
var hashCode = 1
|
var hashCode = 1
|
||||||
for (e in c) {
|
for (e in c) {
|
||||||
hashCode = 31 * hashCode + (e?.hashCode() ?: 0)
|
hashCode = 31 * hashCode + (e?.hashCode() ?: 0)
|
||||||
hashCode = hashCode or 0 // make sure we don't overflow
|
|
||||||
}
|
}
|
||||||
return hashCode
|
return hashCode
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public abstract class AbstractSet<out E> protected constructor() : AbstractColle
|
|||||||
internal fun unorderedHashCode(c: Collection<*>): Int {
|
internal fun unorderedHashCode(c: Collection<*>): Int {
|
||||||
var hashCode = 0
|
var hashCode = 0
|
||||||
for (element in c) {
|
for (element in c) {
|
||||||
hashCode = (hashCode + (element?.hashCode() ?: 0)) or 0
|
hashCode += (element?.hashCode() ?: 0)
|
||||||
}
|
}
|
||||||
return hashCode
|
return hashCode
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user