Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions client/src/com/aerospike/client/lua/LuaBytes.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,14 @@ public int getLittleInt16(int offset) {
}

public int getBigInt32(int offset) {
if (offset < 0 || offset + 4 > this.length) {
// Cache fields to local variables to avoid repeated field access and inline byte->int conversion.
byte[] b = this.bytes;
int len = this.length;
if (offset < 0 || offset + 4 > len) {
return 0;
}
return Buffer.bytesToInt(bytes, offset);
int i = offset;
return ((b[i] & 0xFF) << 24) | ((b[i + 1] & 0xFF) << 16) | ((b[i + 2] & 0xFF) << 8) | (b[i + 3] & 0xFF);
}

public int getLittleInt32(int offset) {
Expand Down