From 01848d2adb6494f4f221f61a40e6ae3918e1e40d Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Thu, 9 Jul 2020 00:00:00 -0500 Subject: [PATCH] top: make that 'cpu_prt' function a tad more efficient This commit only eliminates two 'nop' instructions and one 'jmp' instruction. However, it makes that C source code look a little bit prettier than it looked before. [ and yes, some unnecessary parenthesis were used to ] [ force an alignment of some related lines. it costs ] [ us nothing in extra code yet helps in readability. ] Signed-off-by: Jim Warner --- top/top.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/top/top.c b/top/top.c index 6896128a..53f0ce8a 100644 --- a/top/top.c +++ b/top/top.c @@ -5319,14 +5319,13 @@ static inline int cpu_prt (const char *str, int nobuf) { char *p; p = scat(row, str); - if (nobuf || !Curwin->rc.double_up) - goto flush_it; - if (!tog) { + if (Curwin->rc.double_up + && (!nobuf) + && (!tog)) { scat(p, Double_sp); tog = 1; return 0; } -flush_it: scat(p, "\n"); show_special(0, row); row[0] = '\0';