Skip to content

Commit

Permalink
Implement map on HashedAbstractPartition
Browse files Browse the repository at this point in the history
Summary:
We have `map` on PatriciaTreeMapAbstractPartition, but not on HashedAbstractPartition.
Let's fix that.
This avoid to perform full copies in Mariana Trench.

Reviewed By: arnaudvenet

Differential Revision: D49688135

fbshipit-source-id: 54f56fa98fabd652f7719f1991ac52e967b06cf6
  • Loading branch information
arthaud authored and facebook-github-bot committed Sep 30, 2023
1 parent 2a87a29 commit b3160b0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/sparta/HashedAbstractPartition.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ class HashedAbstractPartition final
return *this;
}

template <typename Operation> // void(Domain*)
void map(Operation&& f) {
if (is_top()) {
return;
}
m_map.map(std::forward<Operation>(f));
}

bool is_top() const { return m_is_top; }

bool is_bottom() const { return !m_is_top && m_map.empty(); }
Expand Down

0 comments on commit b3160b0

Please sign in to comment.