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
This commit is contained in:
Christian Göttsche
2020-10-15 21:45:38 +02:00
committed by cgzones
parent a63cfc8b7c
commit e9246abff8
3 changed files with 27 additions and 14 deletions

View File

@ -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)