diff options
author | kn <kn@cvs.openbsd.org> | 2020-06-23 19:12:48 +0000 |
---|---|---|
committer | kn <kn@cvs.openbsd.org> | 2020-06-23 19:12:48 +0000 |
commit | 5263407989158c13254c768eda79595e119bd755 (patch) | |
tree | 49e99f102bf2093d7672b38a7af654bcb44f76e3 /usr.bin/top | |
parent | 67257b6a9a656f8fb03974b051d98d68b33a725d (diff) |
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
Diffstat (limited to 'usr.bin/top')
-rw-r--r-- | usr.bin/top/machine.c | 7 |
1 files changed, 2 insertions, 5 deletions
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 <tholo@sigmasoft.com> @@ -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; |