summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Scott <natoscott@users.noreply.github.com>2022-05-01 16:21:13 +1000
committerGitHub <noreply@github.com>2022-05-01 16:21:13 +1000
commit10b541b5e4ccd59dc4a6301b58d97a37a90b4228 (patch)
tree66968fd1948e59f21347b2f1cd7a8567e73acf8a
parentcde72dd0b0bcc971ffa0a343e4a5177eed1b8765 (diff)
Update Settings_newScreen with single-line sortKey checking.
Co-authored-by: BenBE <BenBE@geshi.org>
-rw-r--r--Settings.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/Settings.c b/Settings.c
index 0b8050d8..a6303741 100644
--- a/Settings.c
+++ b/Settings.c
@@ -271,11 +271,7 @@ static void ScreenSettings_readFields(ScreenSettings* ss, Hashtable* columns, co
ScreenSettings* Settings_newScreen(Settings* this, const ScreenDefaults* defaults) {
int sortKey = defaults->sortKey ? toFieldIndex(this->dynamicColumns, defaults->sortKey) : PID;
- int sortDesc;
- if (sortKey >= 0 && sortKey < LAST_PROCESSFIELD)
- sortDesc = Process_fields[sortKey].defaultSortDesc;
- else
- sortDesc = 1;
+ int sortDesc = (sortKey >= 0 && sortKey < LAST_PROCESSFIELD) ? Process_fields[sortKey].defaultSortDesc : 1;
ScreenSettings* ss = xMalloc(sizeof(ScreenSettings));
*ss = (ScreenSettings) {

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