Skip to content

Commit

Permalink
fix: AllocationTracker::Remove return value was reversed (#3341)
Browse files Browse the repository at this point in the history
  • Loading branch information
romange authored Jul 19, 2024
1 parent be59b5e commit 4e8c6ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/allocation_tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ bool AllocationTracker::Remove(size_t lower_bound, size_t upper_bound) {
}),
tracking_.end());

return before_size == tracking_.size();
return before_size != tracking_.size();
}

void AllocationTracker::Clear() {
Expand Down
2 changes: 2 additions & 0 deletions src/core/allocation_tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class AllocationTracker {
bool Add(const TrackingInfo& info);

// Removes all tracking exactly matching lower_bound and upper_bound.
// Returns true if the tracking range [lower_bound, upper_bound] was removed
// and false, otherwise.
bool Remove(size_t lower_bound, size_t upper_bound);

// Clears *all* tracking.
Expand Down

0 comments on commit 4e8c6ce

Please sign in to comment.