Skip to content

Commit 391527a

Browse files
committed
[Java] Reduce allocation when displaying var data in Java codecs.
1 parent 94bdcf9 commit 391527a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3262,14 +3262,14 @@ private void appendDecoderDisplay(
32623262
append(sb, indent, "builder.append(\"" + varDataName + Separators.KEY_VALUE + "\");");
32633263
if (null == characterEncoding)
32643264
{
3265-
append(sb, indent, "builder.append(" + varDataName + "Length() + \" bytes of raw data\");");
3265+
append(sb, indent, "builder.append(" + varDataName + "Length()).append(\" bytes of raw data\");");
32663266
append(sb, indent,
32673267
"parentMessage.limit(parentMessage.limit() + " + varDataName + "HeaderLength() + " +
32683268
varDataName + "Length());");
32693269
}
32703270
else
32713271
{
3272-
append(sb, indent, "builder.append('\\'' + " + varDataName + "() + '\\'');");
3272+
append(sb, indent, "builder.append('\\'').append(" + varDataName + "()).append('\\'');");
32733273
}
32743274

32753275
lengthBeforeLastGeneratedSeparator = sb.length();

0 commit comments

Comments
 (0)