adriancole commented on a change in pull request #2582: Reuse char[] buffer
when decoding hex fields.
URL: https://github.com/apache/incubator-zipkin/pull/2582#discussion_r283085253
##########
File path: zipkin/src/main/java/zipkin2/internal/Proto3Fields.java
##########
@@ -190,15 +197,21 @@ static int decodeLowerHex(char c) {
@Override String readValue(Buffer buffer, int length) {
length *= 2;
- char[] result = new char[length];
+
+ // All our hex fields are at most 32 characters.
+ if (length > 32) {
Review comment:
maybe use assert here as that will eliminate the runtime check?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services