Skip to content

Commit 8c7c43f

Browse files
committed
[Java] Tidy up after #1092.
1 parent 582af43 commit 8c7c43f

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,18 +2069,10 @@ private CharSequence generateEnumProperty(
20692069
if (fieldToken.isConstantEncoding())
20702070
{
20712071
final String constValue = fieldToken.encoding().constValue().toString();
2072-
2072+
final int lastDotIndex = constValue.lastIndexOf('.');
20732073
// If constValue already contains the type prefix (e.g., "filterType.TrailingDelta"),
20742074
// extract just the enum value name
2075-
final String enumValue;
2076-
if (constValue.contains("."))
2077-
{
2078-
enumValue = constValue.substring(constValue.lastIndexOf('.') + 1);
2079-
}
2080-
else
2081-
{
2082-
enumValue = constValue;
2083-
}
2075+
final String enumValue = -1 == lastDotIndex ? constValue : constValue.substring(lastDotIndex + 1);
20842076

20852077
return String.format("\n" +
20862078
"%1$s" +

0 commit comments

Comments
 (0)