Skip to content

Commit 93882fc

Browse files
committed
Minor improvement for readBuffer interop message
1 parent e93794e commit 93882fc

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/PythonAbstractObject.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2802,9 +2802,7 @@ public void readBuffer(long byteOffset, byte[] destination, int destinationOffse
28022802
throw InvalidBufferOffsetException.create(byteOffset, length);
28032803
}
28042804
int offset = toIntNode.executeWithThrow(inliningTarget, byteOffset, raiseNode, PythonBuiltinClassType.OverflowError);
2805-
for (int i = 0; i < length; i++) {
2806-
destination[destinationOffset + i] = bufferLib.readByte(this, offset + i);
2807-
}
2805+
bufferLib.readIntoByteArray(this, offset, destination, destinationOffset, length);
28082806
} else {
28092807
throw UnsupportedMessageException.create();
28102808
}

0 commit comments

Comments
 (0)