Skip to content

Commit

Permalink
Add right_bound optimization
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
  • Loading branch information
zhiburt committed Oct 21, 2020
1 parent 02e5590 commit 280d41b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ProcessList.c
Expand Up @@ -145,7 +145,8 @@ static int ProcessList_updateTreeSetLayer(ProcessList* this, int left_bound, int
int currentIndent = indent == -1 ? 0 : indent | (1 << level);
int nextIndent = indent == -1 ? 0 : (i < size - 1) ? currentIndent : indent;

int newLeftBound = proc->tree_index+1;
int newLeftBound = proc->tree_index+1;
int newRightBound = (i < size - 1) ? ((Process*) (Vector_get(layer, i+1)))->tree_index : right_bound;
ProcessList_updateTreeSetLayer(this, newLeftBound, right_bound, deep+1, proc->tree_left, proc->tree_right, index, tree_index, nextIndent);

int newRight = (*tree_index)++;
Expand Down

0 comments on commit 280d41b

Please sign in to comment.