mirror of https://github.com/xzeldon/htop.git
Apply suggestions from code review
Co-authored-by: BenBE <BenBE@geshi.org>
This commit is contained in:
parent
c7f634ec21
commit
d5ff5c48a8
2
Action.c
2
Action.c
|
@ -174,7 +174,7 @@ static Htop_Reaction actionSetSortColumn(State* st) {
|
||||||
char* name = NULL;
|
char* name = NULL;
|
||||||
if (fields[i] >= LAST_PROCESSFIELD) {
|
if (fields[i] >= LAST_PROCESSFIELD) {
|
||||||
DynamicColumn* column = Hashtable_get(dynamicColumns, fields[i]);
|
DynamicColumn* column = Hashtable_get(dynamicColumns, fields[i]);
|
||||||
if (column == NULL)
|
if (!column)
|
||||||
continue;
|
continue;
|
||||||
name = xStrdup(column->caption ? column->caption : column->name);
|
name = xStrdup(column->caption ? column->caption : column->name);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -287,7 +287,7 @@ void PCPDynamicColumn_writeField(PCPDynamicColumn* this, const Process* proc, Ri
|
||||||
int PCPDynamicColumn_compareByKey(const PCPProcess* p1, const PCPProcess* p2, ProcessField key) {
|
int PCPDynamicColumn_compareByKey(const PCPProcess* p1, const PCPProcess* p2, ProcessField key) {
|
||||||
const PCPDynamicColumn* column = Hashtable_get(p1->super.processList->dynamicColumns, key);
|
const PCPDynamicColumn* column = Hashtable_get(p1->super.processList->dynamicColumns, key);
|
||||||
|
|
||||||
if (column == NULL)
|
if (!column)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
size_t metric = column->id;
|
size_t metric = column->id;
|
||||||
|
|
Loading…
Reference in New Issue