-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use constants for token start/end symbols #285
Conversation
private String reconstructImage() { | ||
StringBuilder builder = new StringBuilder().append(master.getImage()); | ||
|
||
for (Node n : getChildren()) { | ||
builder.append(n.getMaster().getImage()); | ||
} | ||
|
||
builder.append("{% ").append(getEndName()). append(" %}"); | ||
builder.append(TokenScannerSymbols.TOKEN_EXPR_START).append(TokenScannerSymbols.TOKEN_TAG).append(" ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this just one append with a String.format
for readability? The StringBuilder makes sense for the above code however makes this bit hard to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, done. I think it's a bit better now.
Codecov Report
@@ Coverage Diff @@
## master #285 +/- ##
============================================
+ Coverage 72.28% 72.32% +0.03%
Complexity 1497 1497
============================================
Files 234 234
Lines 4648 4654 +6
Branches 739 739
============================================
+ Hits 3360 3366 +6
Misses 1033 1033
Partials 255 255
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
int TOKEN_EXPR_START = '{'; | ||
int TOKEN_EXPR_END = '}'; | ||
int TOKEN_NEWLINE = '\n'; | ||
char TOKEN_PREFIX_CHAR = '{'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for convenience it might be nice to have constants for {%
, %}
, {{
and }}
I forgot to include this change in my previous PR: #282