diff options
author | pjulien <pjulien@gmail.com> | 2016-04-18 21:43:28 -0400 |
---|---|---|
committer | pjulien <pjulien@gmail.com> | 2016-04-18 21:43:28 -0400 |
commit | 9fb87f813b77f4dbb96ae8fa9420f5f77b247489 (patch) | |
tree | 34643e2bb15785cd1cdd1d386a7a308e68ef4740 /java | |
parent | b0146b3d9a0e5f48269ad5186dc9c75023685b85 (diff) | |
download | flatbuffers-9fb87f813b77f4dbb96ae8fa9420f5f77b247489.tar.gz flatbuffers-9fb87f813b77f4dbb96ae8fa9420f5f77b247489.tar.bz2 flatbuffers-9fb87f813b77f4dbb96ae8fa9420f5f77b247489.zip |
size the allocation to the required bytes
Diffstat (limited to 'java')
-rw-r--r-- | java/com/google/flatbuffers/Table.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/java/com/google/flatbuffers/Table.java b/java/com/google/flatbuffers/Table.java index f6ae4706..40876542 100644 --- a/java/com/google/flatbuffers/Table.java +++ b/java/com/google/flatbuffers/Table.java @@ -95,7 +95,7 @@ public class Table { int required = (int)((float)length * decoder.maxCharsPerByte()); CharBuffer dst = CHAR_BUFFER.get(); if (dst == null || dst.capacity() < required) { - dst = CharBuffer.allocate(Math.max(required, 128)); + dst = CharBuffer.allocate(required); CHAR_BUFFER.set(dst); } |