diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-10-15 21:45:38 +0200 |
---|---|---|
committer | cgzones <cgzones@googlemail.com> | 2020-10-16 19:47:34 +0200 |
commit | e9246abff8010ec9a9624f004364a3851b6daad3 (patch) | |
tree | 5c71a7e117736c4864099932ceb750b285741007 /ProcessList.c | |
parent | a63cfc8b7c172aa7e849521a479d39af737681a8 (diff) |
Misc Vector updates
- Move swap() macro to source file and implement as function
- Implement Vector_get() and Vector_size() as inline functions
to make them type safe and avoid lhs usage
- Comment comparison statistics, they are only needed for performance
testing
Diffstat (limited to 'ProcessList.c')
-rw-r--r-- | ProcessList.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ProcessList.c b/ProcessList.c index e509b897..1b364cfc 100644 --- a/ProcessList.c +++ b/ProcessList.c @@ -127,12 +127,12 @@ static void ProcessList_buildTree(ProcessList* this, pid_t pid, int level, int i Process* process = (Process*) (Vector_get(children, i)); if (!show) process->show = false; - int s = this->processes2->items; + int s = Vector_size(this->processes2); if (direction == 1) Vector_add(this->processes2, process); else Vector_insert(this->processes2, 0, process); - assert(this->processes2->items == s+1); (void)s; + assert(Vector_size(this->processes2) == s+1); (void)s; int nextIndent = indent | (1 << level); ProcessList_buildTree(this, process->pid, level+1, (i < size - 1) ? nextIndent : indent, direction, show ? process->showChildren : false); if (i == size - 1) |