Commit a33db02a authored by David Schulz's avatar David Schulz Committed by hjk

Debugger: Optimize insert watch item.

Change-Id: If15afbbc7bcf33367755cfd61d47670a28038e6f
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 6d3f81b0
......@@ -1241,15 +1241,15 @@ void WatchHandler::insertItem(WatchItem *item)
void WatchModel::insertItem(WatchItem *item)
{
WatchItem *existing = findItem(item->iname);
if (existing)
WatchItem *parent = findItem(parentName(item->iname));
QTC_ASSERT(parent, return);
if (WatchItem *existing = parent->findItem(item->iname))
removeItem(existing);
//item->walkTree([item](TreeItem *sub) { sub->sortChildren(&watchItemSorter); });
item->sortChildren(&watchItemSorter);
WatchItem *parent = findItem(parentName(item->iname));
QTC_ASSERT(parent, return);
const int row = findInsertPosition(parent->children(), item);
parent->insertChild(row, item);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment