Skip to content

Commit

Permalink
eqrel: Simplify insertAll
Browse files Browse the repository at this point in the history
This loop isn't parallel, so there's no reason to use getChunks. Also, use
modern C++ for-each loops and structured bindings.
  • Loading branch information
langston-barrett committed Apr 29, 2022
1 parent db45ef0 commit bf98599
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/include/souffle/datastructure/EquivalenceRelation.h
Expand Up @@ -114,14 +114,9 @@ class EquivalenceRelation {
other.genAllDisjointSetLists();

// iterate over partitions at a time
for (typename StatesMap::chunk it : other.equivalencePartition.getChunks(MAX_THREADS)) {
for (auto& p : it) {
value_type rep = p.first;
StatesList& pl = *p.second;
const std::size_t ksize = pl.size();
for (std::size_t i = 0; i < ksize; ++i) {
this->sds.unionNodes(rep, pl.get(i));
}
for (auto&& [rep, pl] : other.equivalencePartition) {
for (auto& elem : pl) {
this->sds.unionNodes(rep, elem);
}
}
// invalidate iterators unconditionally
Expand Down

0 comments on commit bf98599

Please sign in to comment.