From d5ff5c48a889c1eab6e3792d3f5ca1566cf05491 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Tue, 17 Aug 2021 15:42:10 +1000 Subject: [PATCH] Apply suggestions from code review Co-authored-by: BenBE --- Action.c | 2 +- pcp/PCPDynamicColumn.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Action.c b/Action.c index 6e804f68..a63b30e4 100644 --- a/Action.c +++ b/Action.c @@ -174,7 +174,7 @@ static Htop_Reaction actionSetSortColumn(State* st) { char* name = NULL; if (fields[i] >= LAST_PROCESSFIELD) { DynamicColumn* column = Hashtable_get(dynamicColumns, fields[i]); - if (column == NULL) + if (!column) continue; name = xStrdup(column->caption ? column->caption : column->name); } else { diff --git a/pcp/PCPDynamicColumn.c b/pcp/PCPDynamicColumn.c index 4051e101..3c4e6797 100644 --- a/pcp/PCPDynamicColumn.c +++ b/pcp/PCPDynamicColumn.c @@ -287,7 +287,7 @@ void PCPDynamicColumn_writeField(PCPDynamicColumn* this, const Process* proc, Ri int PCPDynamicColumn_compareByKey(const PCPProcess* p1, const PCPProcess* p2, ProcessField key) { const PCPDynamicColumn* column = Hashtable_get(p1->super.processList->dynamicColumns, key); - if (column == NULL) + if (!column) return -1; size_t metric = column->id;