1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-08 17:45:24 +02:00

[167620] speeding up larg multiple selections

This commit is contained in:
David McKnight 2007-01-22 18:00:13 +00:00
parent 911aa6d674
commit 726f28992e
2 changed files with 20 additions and 28 deletions

View file

@ -1417,32 +1417,27 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour
} }
protected Item removeFirstItem(Item[] items, Item[] children) {
protected Item removeFirstItem(Item[] items, Item[] children)
{
int firstIndex = 0; int firstIndex = 0;
Item firstItem = null; Item firstItem = null;
int firstItemPosition = 0;
if (items != null) if (items != null)
{ {
for (int i = 0; i < items.length; i++) { for (int i = 0; i < items.length; i++)
{
if (items[i] != null) if (items[i] != null)
{ {
Item current = items[i]; Item current = items[i];
int position = getTreeItemPosition(current, children); items[i] = null;
return current;
if (firstItem == null || position < firstItemPosition) {
firstItem = current;
firstItemPosition = position;
firstIndex = i;
} }
} }
} }
return null;
}
items[firstIndex] = null;
}
return firstItem;
}
/** /**
@ -1535,6 +1530,7 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour
return pos; return pos;
} }
/** /**
* Expand a given filter, given a subsystem that contains a reference to the filter's pool. * Expand a given filter, given a subsystem that contains a reference to the filter's pool.
* This will expand down to the filter if needed * This will expand down to the filter if needed

View file

@ -1417,32 +1417,27 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour
} }
protected Item removeFirstItem(Item[] items, Item[] children) {
protected Item removeFirstItem(Item[] items, Item[] children)
{
int firstIndex = 0; int firstIndex = 0;
Item firstItem = null; Item firstItem = null;
int firstItemPosition = 0;
if (items != null) if (items != null)
{ {
for (int i = 0; i < items.length; i++) { for (int i = 0; i < items.length; i++)
{
if (items[i] != null) if (items[i] != null)
{ {
Item current = items[i]; Item current = items[i];
int position = getTreeItemPosition(current, children); items[i] = null;
return current;
if (firstItem == null || position < firstItemPosition) {
firstItem = current;
firstItemPosition = position;
firstIndex = i;
} }
} }
} }
return null;
}
items[firstIndex] = null;
}
return firstItem;
}
/** /**
@ -1535,6 +1530,7 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour
return pos; return pos;
} }
/** /**
* Expand a given filter, given a subsystem that contains a reference to the filter's pool. * Expand a given filter, given a subsystem that contains a reference to the filter's pool.
* This will expand down to the filter if needed * This will expand down to the filter if needed