adriancole commented on a change in pull request #2583: Remove array copy when decoding UTF-8
field.
URL: https://github.com/apache/incubator-zipkin/pull/2583#discussion_r283086580
##########
File path: zipkin/src/main/java/zipkin2/internal/Proto3Fields.java
##########
@@ -216,7 +216,9 @@ static int decodeLowerHex(char c) {
}
@Override String readValue(Buffer buffer, int length) {
- return new String(buffer.readByteArray(length), UTF_8);
+ String result = new String(buffer.toByteArrayUnsafe(), buffer.pos(), length, UTF_8);
Review comment:
this is the important part. those not looking carefully might miss this!
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
|