1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fix bogus performance improvement for path entry comparison

This commit is contained in:
Anton Leherbauer 2008-02-25 13:22:20 +00:00
parent fe2db58147
commit eda39314e7

View file

@ -96,20 +96,15 @@ public abstract class APathEntry extends PathEntry {
return false;
}
int i=0;
// performance: iterate to first non-identical path
for (; i < excludeLength; i++) {
if (exclusionPatterns[i] == otherExcludes[i]) {
continue;
}
}
Set<String> excludeSet = new HashSet<String>();
Set<String> otherSet = new HashSet<String>();
for (; i < excludeLength; i++) {
// compare toStrings instead of IPaths
// since IPath.equals is specified to ignore trailing separators
excludeSet.add(exclusionPatterns[i].toString());
otherSet.add(otherExcludes[i].toString());
for (int i=0; i < excludeLength; i++) {
if (exclusionPatterns[i] != otherExcludes[i]) {
// compare toStrings instead of IPaths
// since IPath.equals is specified to ignore trailing separators
excludeSet.add(exclusionPatterns[i].toString());
otherSet.add(otherExcludes[i].toString());
}
}
if (!excludeSet.equals(otherSet)) {
return false;