Skip to content

Commit

Permalink
[hotfix] [core] Avoid array copying in LinkedOptionalMapSerializer
Browse files Browse the repository at this point in the history
  • Loading branch information
tzulitai committed Mar 13, 2019
1 parent 939038f commit d6b94e8
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ private static <T> void writeFramed(DataOutputView out, BiConsumerWithException<
DataOutputSerializer frame = new DataOutputSerializer(64);
writer.accept(frame, item);

final byte[] buffer = frame.getCopyOfBuffer();
out.writeInt(buffer.length);
out.write(buffer);
final byte[] buffer = frame.getSharedBuffer();
final int bufferSize = frame.length();
out.writeInt(bufferSize);
out.write(buffer, 0, bufferSize);
}

@Nullable
Expand Down

0 comments on commit d6b94e8

Please sign in to comment.