Skip to content

Commit 0ebb75f

Browse files
eqrel: Simplify insertAll
This loop isn't parallel, so there's no reason to use getChunks. Also, use modern C++ for-each loops and structured bindings.
1 parent db45ef0 commit 0ebb75f

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/include/souffle/datastructure/EquivalenceRelation.h

+4-8
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,10 @@ class EquivalenceRelation {
114114
other.genAllDisjointSetLists();
115115

116116
// iterate over partitions at a time
117-
for (typename StatesMap::chunk it : other.equivalencePartition.getChunks(MAX_THREADS)) {
118-
for (auto& p : it) {
119-
value_type rep = p.first;
120-
StatesList& pl = *p.second;
121-
const std::size_t ksize = pl.size();
122-
for (std::size_t i = 0; i < ksize; ++i) {
123-
this->sds.unionNodes(rep, pl.get(i));
124-
}
117+
for (auto&& [rep, pl] : other.equivalencePartition) {
118+
const std::size_t ksize = pl->size();
119+
for (std::size_t i = 0; i < ksize; ++i) {
120+
this->sds.unionNodes(rep, pl->get(i));
125121
}
126122
}
127123
// invalidate iterators unconditionally

0 commit comments

Comments
 (0)