diff --git a/util/ng_find_matches.cpp b/util/ng_find_matches.cpp index 0890319d..8c48081f 100644 --- a/util/ng_find_matches.cpp +++ b/util/ng_find_matches.cpp @@ -605,8 +605,8 @@ struct StateSet { } #endif - flat_set getActiveStates() const { - flat_set result; + vector getActiveStates() const { + vector result; for (u32 dist = 0; dist <= edit_distance; dist++) { // get all shadow vertices (including original graph) @@ -614,8 +614,8 @@ struct StateSet { for (size_t id = cur_shadow_vertices.find_first(); id != cur_shadow_vertices.npos; id = cur_shadow_vertices.find_next(id)) { - result.emplace(id, dist, shadows_som[dist][id], - State::NODE_SHADOW); + result.emplace_back(id, dist, shadows_som[dist][id], + State::NODE_SHADOW); } // the rest is only valid for edited graphs @@ -628,11 +628,12 @@ struct StateSet { for (size_t id = cur_helper_vertices.find_first(); id != cur_helper_vertices.npos; id = cur_helper_vertices.find_next(id)) { - result.emplace(id, dist, helpers_som[dist][id], - State::NODE_HELPER); + result.emplace_back(id, dist, helpers_som[dist][id], + State::NODE_HELPER); } } + sort_and_unique(result); return result; } @@ -743,6 +744,11 @@ bool operator<(const StateSet::State &a, const StateSet::State &b) { return false; } +bool operator==(const StateSet::State &a, const StateSet::State &b) { + return a.idx == b.idx && a.level == b.level && a.type == b.type && + a.som == b.som; +} + struct fmstate { const size_t num_states; // number of vertices in graph StateSet states; // currently active states