]> granicus.if.org Git - procps-ng/commitdiff
top: optimization for show_special function
authorJim Warner <james.warner@comcast.net>
Mon, 24 Oct 2011 22:20:45 +0000 (17:20 -0500)
committerCraig Small <csmall@enc.com.au>
Thu, 22 Dec 2011 12:48:04 +0000 (23:48 +1100)
top/top.c

index 88392f4d62f2c066769758dcb8f2eda06291e207..614710c091c1f387f5710d92fedf30f41ce0c5e8 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -705,7 +705,7 @@ static inline void show_scroll (void) {
          * what will fit within the current screen width.
          *    Our special formatting consists of:
          *       "some text <_delimiter_> some more text <_delimiter_>...\n"
-         *    Where <_delimiter_> is a two bye combination consisting of a
+         *    Where <_delimiter_> is a two byte combination consisting of a
          *    tilde followed by an ascii digit in the the range of 1 - 8.
          *       examples: ~1,  ~5,  ~8, etc.
          *    The tilde is effectively stripped and the next digit
@@ -767,7 +767,7 @@ static void show_special (int interact, const char *glob) {
                snprintf(tmp, sizeof(tmp), "%s%.*s%s", Curwin->captab[ch], room, sub_beg, Caps_off);
                rp = scat(rp, tmp);
                room -= (sub_end - sub_beg);
-               sub_beg = (sub_end += (ch ? 2 : 1));
+               sub_beg = (sub_end += 2);
                break;
             default:                   // nothin' special, just text
                ++sub_end;