We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae77ff9 commit 4f6253bCopy full SHA for 4f6253b
src/main/java/com/maxmind/db/MultiBuffer.java
@@ -272,15 +272,11 @@ public static MultiBuffer wrap(List<byte[]> chunks) {
272
int offset = 0;
273
int remaining = chunk.length;
274
275
- while (remaining > 0) {
276
- int toPut = remaining;
277
- ByteBuffer buf = ByteBuffer.allocate(toPut);
278
- buf.put(chunk, offset, toPut);
+ if (remaining > 0) {
+ ByteBuffer buf = ByteBuffer.allocate(remaining);
+ buf.put(chunk, offset, remaining);
279
buf.flip();
280
buffers.add(buf);
281
-
282
- offset += toPut;
283
- remaining -= toPut;
284
}
285
286
0 commit comments