Skip to content

Commit c905ff2

Browse files
committed
Add missing if in pjwHash64 implementation
1 parent bd41bee commit c905ff2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TastyPickler.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ class TastyPickler(val rootCls: ClassSymbol) {
7979
*/
8080
private def pjwHash64(data: Array[Byte]): Long = {
8181
var h = 0L
82-
var high = 0L
8382
var i = 0
8483
while (i < data.length) {
8584
h = (h << 4) + data(i)
86-
high = h & 0xF0000000L
87-
h ^= high >> 24
85+
val high = h & 0xF0000000L
86+
if (high != 0)
87+
h ^= high >> 24
8888
h &= ~high
8989
i += 1
9090
}

0 commit comments

Comments
 (0)