diff options
author | Anton Leherbauer | 2008-02-25 13:22:20 +0000 |
---|---|---|
committer | Anton Leherbauer | 2008-02-25 13:22:20 +0000 |
commit | eda39314e74d34ae1b22ef9cd68e8de510303837 (patch) | |
tree | 721a588357e56904e38e465040e549e8b0cb60d5 /core/org.eclipse.cdt.core/model | |
parent | fe2db581477e59747c43cd6318f8af28ad89510d (diff) | |
download | org.eclipse.cdt-eda39314e74d34ae1b22ef9cd68e8de510303837.tar.gz org.eclipse.cdt-eda39314e74d34ae1b22ef9cd68e8de510303837.tar.xz org.eclipse.cdt-eda39314e74d34ae1b22ef9cd68e8de510303837.zip |
Fix bogus performance improvement for path entry comparison
Diffstat (limited to 'core/org.eclipse.cdt.core/model')
-rw-r--r-- | core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java index fd1cf476c0e..b27c170b63b 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java @@ -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; |