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:
parent
911aa6d674
commit
726f28992e
2 changed files with 20 additions and 28 deletions
|
@ -1417,34 +1417,29 @@ 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
items[firstIndex] = null;
|
|
||||||
}
|
}
|
||||||
return firstItem;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move one tree item to a new location
|
* Move one tree item to a new location
|
||||||
*/
|
*/
|
||||||
|
@ -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
|
||||||
|
|
|
@ -1417,34 +1417,29 @@ 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
items[firstIndex] = null;
|
|
||||||
}
|
}
|
||||||
return firstItem;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move one tree item to a new location
|
* Move one tree item to a new location
|
||||||
*/
|
*/
|
||||||
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue