summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2020-12-02 00:16:49 +0100
committerBenBE <BenBE@geshi.org>2020-12-02 23:50:05 +0100
commit2d874177bc5394fdeebdec5eab4f91c2cb92e434 (patch)
tree5e72d7cc4e2b8ab7e261dbcbe8d659fc24fbd084
parentbd24664fc2c85ba82950d20d9d38c12311bb8e23 (diff)
Avoid expensive build of tree when not using it
-rw-r--r--ProcessList.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/ProcessList.c b/ProcessList.c
index 499f36a0..ada0451a 100644
--- a/ProcessList.c
+++ b/ProcessList.c
@@ -564,11 +564,13 @@ void ProcessList_scan(ProcessList* this, bool pauseProcessUpdate) {
}
}
- // Clear out the hashtable to avoid any left-over processes from previous build
- //
- // The sorting algorithm relies on the fact that
- // len(this->displayTreeSet) == len(this->processes)
- Hashtable_clear(this->displayTreeSet);
-
- ProcessList_buildTree(this);
+ if (this->settings->treeView) {
+ // Clear out the hashtable to avoid any left-over processes from previous build
+ //
+ // The sorting algorithm relies on the fact that
+ // len(this->displayTreeSet) == len(this->processes)
+ Hashtable_clear(this->displayTreeSet);
+
+ ProcessList_buildTree(this);
+ }
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy