Skip to content

Commit

Permalink
Removed redundant casts from DirectBinaryDecoder (#2563)
Browse files Browse the repository at this point in the history
thanks to @mystic-lama for this improvement
  • Loading branch information
paliwalashish authored Oct 24, 2023
1 parent 2b19559 commit 6f6cc60
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ public ByteBuffer read(ByteBuffer old, int length) throws IOException {
result = old;
result.clear();
} else {
result = ByteBuffer.allocate((int) length);
result = ByteBuffer.allocate(length);
}
doReadBytes(result.array(), result.position(), (int) length);
result.limit((int) length);
doReadBytes(result.array(), result.position(), length);
result.limit(length);
return result;
}
}
Expand All @@ -65,7 +65,7 @@ public ByteBuffer read(ByteBuffer old, int length) throws IOException {
if (old != null) {
return super.read(old, length);
} else {
return bbi.readBuffer((int) length);
return bbi.readBuffer(length);
}
}
}
Expand Down

0 comments on commit 6f6cc60

Please sign in to comment.