Skip to content

Commit

Permalink
paged_vecvec::clear
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Jul 29, 2024
1 parent 69dcc5f commit ed85cb2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/cista/containers/paged.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ struct paged {
}
}

void clear() {
data_.clear();
for (auto& n : free_list_) {
n.next_ = std::numeric_limits<size_type>::max();
}
}

struct node {
bool empty() const {
return next_ == std::numeric_limits<size_type>::max();
Expand Down
5 changes: 5 additions & 0 deletions include/cista/containers/paged_vecvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ struct paged_vecvec {
idx_.resize(size);
}

void clear() {
paged_.clear();
idx_.clear();
}

Paged paged_;
Index idx_;
};
Expand Down

0 comments on commit ed85cb2

Please sign in to comment.