Avoid creating a new String to qualify types

- This is now slightly faster, which for a method that gets called
    over 1 million times on large projects is significant.
 - We should still look for ways to reduce the number of calls to this
    method.
This commit is contained in:
Juan Martín Sotuyo Dodero
2016-11-11 20:07:22 -03:00
committed by Andreas Dangel
parent 4d8dcf3443
commit 28e2f11003

View File

@ -341,7 +341,7 @@ public class ClassScope extends AbstractJavaScope {
for (String qualified : qualifiedNames) {
int fullLength = qualified.length();
if (qualified.endsWith(typeImage)
&& (fullLength == nameLength || qualified.substring(0, fullLength - nameLength).endsWith("."))) {
&& (fullLength == nameLength || qualified.charAt(fullLength - nameLength - 1) == '.')) {
return qualified;
}
}