]> granicus.if.org Git - procps-ng/commitdiff
top: speed up the collapsed children forest view logic
authorJim Warner <james.warner@comcast.net>
Thu, 9 Aug 2018 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@enc.com.au>
Mon, 13 Aug 2018 10:55:50 +0000 (20:55 +1000)
In forest view mode, once a collapsible parent process
and all of its children (if any) have been identified,
there is no longer a need to scan the remaining tasks.

So this patch will just force a new scan for any other
'Hide_pid' entries which might remain to be identified
after a targeted parent has been completely processed.

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c

index 771f6dbf050eab1ef3c679d7b25b95d8b7ed6778..5a3d9581ccfe110030e7f66066a5485932b5af77 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -4367,6 +4367,8 @@ static void forest_begin (WIN_t *q) {
                   }
                   // children found (and collapsed), so mark that puppy
                   if (children) rSv_Hid(parent) = 'x';
+                  // this will force a check of the next Hide_pid, if any
+                  j = PIDSmaxt;
                }
             }
          }