Skip to content

Commit d746d94

Browse files
committed
[GR-47378] Compare bytes as unsigned bytes
1 parent 7939d69 commit d746d94

File tree

1 file changed

+1
-1
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/bytes

1 file changed

+1
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/bytes/BytesNodes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ protected boolean doCmp(byte[] selfArray, int selfLength, byte[] otherArray, int
966966
return shortcutLengthResult();
967967
}
968968
for (int i = 0; i < Math.min(selfLength, otherLength); i++) {
969-
compareResult = Byte.compare(selfArray[i], otherArray[i]);
969+
compareResult = Integer.compare(Byte.toUnsignedInt(selfArray[i]), Byte.toUnsignedInt(otherArray[i]));
970970
if (compareResult != 0) {
971971
break;
972972
}

0 commit comments

Comments
 (0)