lhotari commented on code in PR #22494:
URL: https://github.com/apache/pulsar/pull/22494#discussion_r1563046536
##########
pulsar-common/src/main/java/org/apache/pulsar/common/util/SimpleTextOutputStream.java:
##########
@@ -44,7 +46,8 @@ public SimpleTextOutputStream write(byte[] a, int offset, int
len) {
}
public SimpleTextOutputStream write(char c) {
- write(String.valueOf(c));
+ singleCharBuffer.put(0, c);
+ buffer.writeCharSequence(singleCharBuffer, CharsetUtil.UTF_8);
Review Comment:
@merlimat good point. I'll add the writeByte optimization for the ascii
character range where it's safe.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]