Avoid expensive build of tree when not using it

This commit is contained in:
Benny Baumann 2020-12-02 00:16:49 +01:00 committed by BenBE
parent bd24664fc2
commit 2d874177bc
1 changed files with 8 additions and 6 deletions

View File

@ -564,11 +564,13 @@ void ProcessList_scan(ProcessList* this, bool pauseProcessUpdate) {
} }
} }
// Clear out the hashtable to avoid any left-over processes from previous build 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) // The sorting algorithm relies on the fact that
Hashtable_clear(this->displayTreeSet); // len(this->displayTreeSet) == len(this->processes)
Hashtable_clear(this->displayTreeSet);
ProcessList_buildTree(this); ProcessList_buildTree(this);
}
} }