Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
JastAdd
relational-rags
Commits
c40c9d86
Commit
c40c9d86
authored
Feb 18, 2020
by
Johannes Mey
Browse files
apply performance bug hint from intellij
parent
647e1f2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/jastadd/DumpTree.jrag
View file @
c40c9d86
...
...
@@ -33,7 +33,7 @@ aspect DumpTree {
public String ASTNode.extraDumpInfo() { return ""; }
public String ASTNode.getTokens() {
java.util.TreeSet<java.lang.reflect.Method> methods = new java.util.TreeSet<>(Comparator.comparing(Method::getName));
java.util.TreeSet<java.lang.reflect.Method> methods = new java.util.TreeSet<>(Comparator.comparing(
java.lang.reflect.
Method::getName));
methods.addAll(java.util.Arrays.asList(getClass().getMethods()));
...
...
@@ -43,7 +43,8 @@ aspect DumpTree {
if (token != null) {
try {
result.append(String.format(" %s=\"%s\"", token.name(), method.invoke(this)));
} catch (IllegalAccessException | java.lang.reflect.InvocationTargetException ignored) {
} catch (IllegalAccessException ignored) {
} catch (java.lang.reflect.InvocationTargetException ignored) {
}
}
}
...
...
src/main/jastadd/backend/PrettyPrinting.jadd
View file @
c40c9d86
...
...
@@ -33,10 +33,10 @@ aspect PrettyPrinting {
aspect Utils {
public String ASTNode.ind(int n) {
String
s = ""
;
String
Builder s = new StringBuilder()
;
for (int i = 0; i < n; i++) {
s
+=
" ";
s
.append(
" "
)
;
}
return s;
return s
.toString()
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment