mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
Cosmetics.
This commit is contained in:
parent
d5d4f19105
commit
e58416919f
1 changed files with 11 additions and 11 deletions
|
@ -6,7 +6,7 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Ferguson (Symbian) - Initial implementation
|
* Andrew Ferguson (Symbian) - Initial implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.index;
|
package org.eclipse.cdt.internal.core.index;
|
||||||
|
|
||||||
|
@ -17,25 +17,25 @@ package org.eclipse.cdt.internal.core.index;
|
||||||
*/
|
*/
|
||||||
public class DefaultFragmentBindingComparator implements IIndexFragmentBindingComparator {
|
public class DefaultFragmentBindingComparator implements IIndexFragmentBindingComparator {
|
||||||
public int compare(IIndexFragmentBinding a, IIndexFragmentBinding b) {
|
public int compare(IIndexFragmentBinding a, IIndexFragmentBinding b) {
|
||||||
int cmp= compareQualifiedNames(a.getQualifiedName(),b.getQualifiedName());
|
int cmp= compareQualifiedNames(a.getQualifiedName(), b.getQualifiedName());
|
||||||
if(cmp==0) {
|
if (cmp == 0) {
|
||||||
int ac= a.getBindingConstant(), bc= b.getBindingConstant();
|
int ac= a.getBindingConstant(), bc= b.getBindingConstant();
|
||||||
cmp= ac<bc ? -1 : (ac>bc ? 1 : 0);
|
cmp= ac < bc ? -1 : (ac > bc ? 1 : 0);
|
||||||
if(cmp==0) {
|
if (cmp == 0) {
|
||||||
cmp= IndexCPPSignatureUtil.compareSignatures(a, b);
|
cmp= IndexCPPSignatureUtil.compareSignatures(a, b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return cmp;
|
return cmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int compareQualifiedNames(String[] afqn, String[] bfqn) {
|
private int compareQualifiedNames(String[] a, String[] b) {
|
||||||
if(afqn.length < bfqn.length)
|
if (a.length < b.length)
|
||||||
return -1;
|
return -1;
|
||||||
if(afqn.length > bfqn.length)
|
if (a.length > b.length)
|
||||||
return 1;
|
return 1;
|
||||||
for(int i=0; i<afqn.length; i++) {
|
for(int i= 0; i < a.length; i++) {
|
||||||
int cmp= afqn[i].compareTo(bfqn[i]);
|
int cmp= a[i].compareTo(b[i]);
|
||||||
if(cmp!=0)
|
if (cmp != 0)
|
||||||
return cmp;
|
return cmp;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue