summaryrefslogtreecommitdiff
path: root/tools/perf/util/rblist.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/rblist.c')
-rw-r--r--tools/perf/util/rblist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/rblist.c b/tools/perf/util/rblist.c
index 0171fb611004..a16cdd2625ad 100644
--- a/tools/perf/util/rblist.c
+++ b/tools/perf/util/rblist.c
@@ -44,6 +44,7 @@ int rblist__add_node(struct rblist *rblist, const void *new_entry)
void rblist__remove_node(struct rblist *rblist, struct rb_node *rb_node)
{
rb_erase(rb_node, &rblist->entries);
+ --rblist->nr_entries;
rblist->node_delete(rblist, rb_node);
}
@@ -87,8 +88,7 @@ void rblist__delete(struct rblist *rblist)
while (next) {
pos = next;
next = rb_next(pos);
- rb_erase(pos, &rblist->entries);
- rblist->node_delete(rblist, pos);
+ rblist__remove_node(rblist, pos);
}
free(rblist);
}