>From 32426c8282d0ec48f20000bc8e9a9c89c3060c8d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 2 Nov 2015 11:55:56 -0500 Subject: [PATCH 1/1] Cache the result of QTreeWidget::selectedItems() It's not a cheap function, so let's not call it twice. Signed-off-by: Thiago Macieira --- scripts/kconfig/qconf.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 91b7e6f..920a252 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -400,10 +400,11 @@ void ConfigList::updateSelection(void) struct menu *menu; enum prop_type type; - if (selectedItems().count() == 0) + QList items = selectedItems(); + if (items.count() == 0) return; - ConfigItem* item = (ConfigItem*)selectedItems().first(); + ConfigItem* item = (ConfigItem*)items.first(); if (!item) return; -- 2.6.2