Commit 9d8ae1b0 authored by pjulien's avatar pjulien

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

eliminating the last remaining allocation in string creation
parent 2de55805
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment