From 04623066d75fb2ac63eed4dd3183740b41cd70c6 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Sun, 8 Feb 2009 16:05:42 +0100 Subject: [PATCH] Don't do unneeded sp_acopy() calls --- src/top.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/top.c b/src/top.c index fae248b1..33a02395 100644 --- a/src/top.c +++ b/src/top.c @@ -561,7 +561,11 @@ void process_find_top(struct process **cpu, struct process **mem, } cur_proc = cur_proc->next; } - sp_acopy(spc_head, cpu, MAX_SP); - sp_acopy(spm_head, mem, MAX_SP); - sp_acopy(spt_head, time, MAX_SP); + + if (top_cpu) + sp_acopy(spc_head, cpu, MAX_SP); + if (top_mem) + sp_acopy(spm_head, mem, MAX_SP); + if (top_time) + sp_acopy(spt_head, time, MAX_SP); }