Alexey Andreev 2015-05-14 14:22:22 +04:00
parent f07a8aec8f
commit 85cfe4814e

View File

@ -1192,23 +1192,22 @@ public class Renderer implements ExprVisitor, StatementVisitor, RenderingContext
} }
Set<String> names = index < debugNames.size() ? debugNames.get(index) : null; Set<String> names = index < debugNames.size() ? debugNames.get(index) : null;
if (minifying || names == null || names.isEmpty()) { StringBuilder sb = new StringBuilder();
--index; --index;
if (index < variableNames.length()) { if (index < variableNames.length()) {
return Character.toString(variableNames.charAt(index)); sb.append(Character.toString(variableNames.charAt(index)));
} else {
return Character.toString(variableNames.charAt(index % variableNames.length())) +
index / variableNames.length();
}
} else { } else {
sb.append(Character.toString(variableNames.charAt(index % variableNames.length())) +
index / variableNames.length());
}
if (!minifying && names != null && !names.isEmpty()) {
List<String> nameList = new ArrayList<>(names); List<String> nameList = new ArrayList<>(names);
Collections.sort(nameList); Collections.sort(nameList);
StringBuilder sb = new StringBuilder();
for (String name : nameList) { for (String name : nameList) {
sb.append('_').append(name); sb.append('_').append(name);
} }
return sb.toString();
} }
return sb.toString();
} }
private String pointerName() { private String pointerName() {