mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-03 12:21:23 +00:00
If the user passes in a {{CharBuffer}} himser, reward him by
eliminating the last remaining allocation in string creation
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user