From 5263407989158c13254c768eda79595e119bd755 Mon Sep 17 00:00:00 2001 From: kn Date: Tue, 23 Jun 2020 19:12:48 +0000 Subject: Remove redundant NULL check For the sake of simplicity and to reflect that the process list is always sorted (default is "cpu"), even if not explicitly requested; this makes it easier to argue about the code around sort order and its selection. OK millert --- usr.bin/top/machine.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'usr.bin/top') diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index b68e910eae5..4ffe48b2db1 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machine.c,v 1.102 2020/01/06 20:05:10 zhuk Exp $ */ +/* $OpenBSD: machine.c,v 1.103 2020/06/23 19:12:47 kn Exp $ */ /*- * Copyright (c) 1994 Thorsten Lockert @@ -491,10 +491,7 @@ get_process_info(struct system_info *si, struct process_select *sel, } } - /* if requested, sort the "interesting" processes */ - if (compare != NULL) - qsort((char *) pref, active_procs, - sizeof(struct kinfo_proc *), compare); + qsort((char *)pref, active_procs, sizeof(struct kinfo_proc *), compare); /* remember active and total counts */ si->p_total = total_procs; si->p_active = pref_len = active_procs; -- cgit v1.2.3