summaryrefslogtreecommitdiffstats
path: root/ProcessList.c
diff options
context:
space:
mode:
authorDenis Lisov <dennis.lissov@gmail.com>2021-12-16 01:33:32 +0300
committerBenBE <BenBE@geshi.org>2022-02-13 19:50:16 +0100
commita3a7958721607b8520199563d478a315dfac678f (patch)
tree46b62cc3320dbcd5183089bb88c82fbd1d918655 /ProcessList.c
parent4aeb146ce838c9bedd98b9d2227e8aa57464f574 (diff)
ProcessList: sort before panel rebuild if needed
Diffstat (limited to 'ProcessList.c')
-rw-r--r--ProcessList.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ProcessList.c b/ProcessList.c
index 1df1990d..ef714b46 100644
--- a/ProcessList.c
+++ b/ProcessList.c
@@ -27,6 +27,7 @@ ProcessList* ProcessList_init(ProcessList* this, const ObjectClass* klass, Users
this->processTable = Hashtable_new(200, false);
this->displayTreeSet = Hashtable_new(200, false);
this->draftingTreeSet = Hashtable_new(200, false);
+ this->needsSort = true;
this->usersTable = usersTable;
this->pidMatchList = pidMatchList;
@@ -496,6 +497,7 @@ void ProcessList_sort(ProcessList* this) {
} else {
Vector_insertionSort(this->processes);
}
+ this->needsSort = false;
}
ProcessField ProcessList_keyAt(const ProcessList* this, int at) {
@@ -531,6 +533,9 @@ void ProcessList_collapseAllBranches(ProcessList* this) {
}
void ProcessList_rebuildPanel(ProcessList* this) {
+ if (this->needsSort)
+ ProcessList_sort(this);
+
const char* incFilter = this->incFilter;
const int currPos = Panel_getSelectedIndex(this->panel);

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