mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-27 19:05:38 +02:00
Performance improvement for path entry comparison
This commit is contained in:
parent
e3404b50f0
commit
f4087a09fc
1 changed files with 11 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2007 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -96,9 +96,16 @@ public abstract class APathEntry extends PathEntry {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Set excludeSet = new HashSet();
|
int i=0;
|
||||||
Set otherSet = new HashSet();
|
// performance: iterate to first non-identical path
|
||||||
for (int i = 0; i < excludeLength; i++) {
|
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
|
// compare toStrings instead of IPaths
|
||||||
// since IPath.equals is specified to ignore trailing separators
|
// since IPath.equals is specified to ignore trailing separators
|
||||||
excludeSet.add(exclusionPatterns[i].toString());
|
excludeSet.add(exclusionPatterns[i].toString());
|
||||||
|
|
Loading…
Add table
Reference in a new issue