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:
parent
fe2db58147
commit
eda39314e7
1 changed files with 7 additions and 12 deletions
|
@ -96,20 +96,15 @@ public abstract class APathEntry extends PathEntry {
|
||||||
return false;
|
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> excludeSet = new HashSet<String>();
|
||||||
Set<String> otherSet = new HashSet<String>();
|
Set<String> otherSet = new HashSet<String>();
|
||||||
for (; i < excludeLength; i++) {
|
for (int i=0; i < excludeLength; i++) {
|
||||||
// compare toStrings instead of IPaths
|
if (exclusionPatterns[i] != otherExcludes[i]) {
|
||||||
// since IPath.equals is specified to ignore trailing separators
|
// compare toStrings instead of IPaths
|
||||||
excludeSet.add(exclusionPatterns[i].toString());
|
// since IPath.equals is specified to ignore trailing separators
|
||||||
otherSet.add(otherExcludes[i].toString());
|
excludeSet.add(exclusionPatterns[i].toString());
|
||||||
|
otherSet.add(otherExcludes[i].toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!excludeSet.equals(otherSet)) {
|
if (!excludeSet.equals(otherSet)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue