Skip to content

Commit 3fdf3fa

Browse files
committed
Remove unnecessary buffer duplication
1 parent 6a555b8 commit 3fdf3fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/maxmind/db/MultiBuffer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public byte get(long index) {
147147
public double getDouble() {
148148
int bufIndex = (int) (position / CHUNK_SIZE);
149149
int off = (int) (position % CHUNK_SIZE);
150-
ByteBuffer buf = buffers.get(bufIndex).duplicate();
150+
ByteBuffer buf = buffers.get(bufIndex);
151151
buf.position(off);
152152
double value;
153153
if (buf.remaining() >= 8) {
@@ -166,7 +166,7 @@ public double getDouble() {
166166
public float getFloat() {
167167
int bufIndex = (int) (position / CHUNK_SIZE);
168168
int off = (int) (position % CHUNK_SIZE);
169-
ByteBuffer buf = buffers.get(bufIndex).duplicate();
169+
ByteBuffer buf = buffers.get(bufIndex);
170170
buf.position(off);
171171
float value;
172172
if (buf.remaining() >= 4) {

0 commit comments

Comments
 (0)