Skip to content

Commit fdf52a3

Browse files
committed
[GR-47378] Compare bytes as unsigned bytes
1 parent 122df4a commit fdf52a3

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
@@ -972,7 +972,7 @@ protected boolean doCmp(byte[] selfArray, int selfLength, byte[] otherArray, int
972972
return shortcutLengthResult();
973973
}
974974
for (int i = 0; i < Math.min(selfLength, otherLength); i++) {
975-
compareResult = Byte.compare(selfArray[i], otherArray[i]);
975+
compareResult = Integer.compare(Byte.toUnsignedInt(selfArray[i]), Byte.toUnsignedInt(otherArray[i]));
976976
if (compareResult != 0) {
977977
break;
978978
}

0 commit comments

Comments
 (0)