Skip to content

Commit

Permalink
Use revese iterators in egfd_validation.cpp: ReverseConstruction
Browse files Browse the repository at this point in the history
Use reverse iterators to traverse set in reverse order, instead of
messing with normal iterators
  • Loading branch information
p-senichenkov committed Dec 19, 2024
1 parent 7adcb42 commit 7940b8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/algorithms/gfd/egfd_validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ void ReverseConstruction(std::set<vertex_t> const& lev, graph_t const& graph, gr
std::map<vertex_t, std::set<vertex_t>>& candidates,
std::map<vertex_t, int>& cnts,
std::map<vertex_t, std::set<vertex_t>>& unvisited_neighbours) {
for (std::set<vertex_t>::iterator j = --lev.end(); j != std::next(lev.begin(), -1); --j) {
for (auto j = lev.rbegin(); j != lev.rend(); ++j) {
vertex_t u = *j;
int cnt = 0;
if (unvisited_neighbours.find(u) != unvisited_neighbours.end()) {
Expand Down

0 comments on commit 7940b8a

Please sign in to comment.