If the user passes in a {{CharBuffer}} himser, reward him by

eliminating the last remaining allocation in string creation
This commit is contained in:
pjulien
2016-05-21 09:19:43 -04:00
parent 2de558057d
commit 9d8ae1b0c3

View File

@@ -382,7 +382,8 @@ public class FlatBufferBuilder {
dst.clear();
CharBuffer src = CharBuffer.wrap(s);
CharBuffer src = s instanceof CharBuffer ? (CharBuffer) s :
CharBuffer.wrap(s);
CoderResult result = encoder.encode(src, dst, true);
if (result.isError()) {
try {