imbajin commented on code in PR #2861:
URL:
https://github.com/apache/incubator-hugegraph/pull/2861#discussion_r2313268217
##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/serializer/BytesBuffer.java:
##########
@@ -162,16 +165,21 @@ public int remaining() {
private void require(int size) {
// Does need to resize?
- if (this.buffer.limit() - this.buffer.position() >= size) {
+ if (this.buffer.remaining() >= size) {
Review Comment:
**Bug fix**: Good catch! Using `buffer.remaining()` is more efficient and
semantically correct than manually calculating `buffer.limit() -
buffer.position()`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]