From c6b66a75ea140f5b3ed50b273be4c9b3c60ebfad Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Wed, 2 Dec 2020 18:52:09 +0100 Subject: Minor code streamlining --- MainPanel.c | 6 +----- ProcessList.c | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/MainPanel.c b/MainPanel.c index 0f8d0e75..5e3a54c1 100644 --- a/MainPanel.c +++ b/MainPanel.c @@ -25,11 +25,7 @@ static const char* const MainFunctions[] = {"Help ", "Setup ", "Search", "Filt void MainPanel_updateTreeFunctions(MainPanel* this, bool mode) { FunctionBar* bar = MainPanel_getFunctionBar(this); - if (mode) { - FunctionBar_setLabel(bar, KEY_F(5), "Sorted"); - } else { - FunctionBar_setLabel(bar, KEY_F(5), "Tree "); - } + FunctionBar_setLabel(bar, KEY_F(5), mode ? "Sorted" : "Tree "); } void MainPanel_pidSearch(MainPanel* this, int ch) { diff --git a/ProcessList.c b/ProcessList.c index 250e85ec..59a7c387 100644 --- a/ProcessList.c +++ b/ProcessList.c @@ -431,11 +431,11 @@ static void ProcessList_buildTree(ProcessList* this) { } void ProcessList_sort(ProcessList* this) { - if (!this->settings->treeView) { - Vector_insertionSort(this->processes); - } else { + if (this->settings->treeView) { ProcessList_updateTreeSet(this); Vector_quickSortCustomCompare(this->processes, ProcessList_treeProcessCompare); + } else { + Vector_insertionSort(this->processes); } } -- cgit v1.2.3