/*
- * Copyright (c) 2015-2016, Intel Corporation
+ * Copyright (c) 2015-2017, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
explicit exit_info(NFAVertex v) : exit(v) {}
NFAVertex exit;
- ue2::unordered_set<NFAVertex> open;
+ flat_set<NFAVertex> open;
};
}
const ue2::unordered_set<NFAVertex> &r,
NFAVertex v, vector<exit_info> *exits) {
// set when we find our first candidate.
- ue2::unordered_set<NFAVertex> *open = nullptr;
+ decltype(exit_info::open) *open = nullptr;
/* find the set of vertices reachable from v which are not in r */
for (auto w : adjacent_vertices_range(v, g)) {
*/
static
bool exitValid(UNUSED const AcyclicGraph &g, const vector<exit_info> &exits,
- const ue2::unordered_set<NFAVertex> &open_jumps) {
+ const flat_set<NFAVertex> &open_jumps) {
if (exits.empty() || (exits.size() < 2 && open_jumps.empty())) {
return true;
}
/* in exits of prev region;
* out exits from candidate */
vector<exit_info> *exits,
- ue2::unordered_set<NFAVertex> *open_jumps) {
+ flat_set<NFAVertex> *open_jumps) {
if (it == ite) {
candidate->clear();
exits->clear();
return;
}
- ue2::unordered_set<NFAVertex> enters = (*exits)[0].open;
+ auto enters = (*exits)[0].open; // copy
candidate->clear();
for (; it != ite; ++it) {
if (it != ite) {
enters.erase(*it);
- open_jumps->swap(enters);
+ *open_jumps = move(enters);
DEBUG_PRINTF("oj size = %zu\n", open_jumps->size());
++it;
} else {
vector<NFAVertex>::const_reverse_iterator t_it = topo.rbegin();
vector<exit_info> exits;
ue2::unordered_set<NFAVertex> candidate;
- ue2::unordered_set<NFAVertex> open_jumps;
+ flat_set<NFAVertex> open_jumps;
DEBUG_PRINTF("adding %zu to current\n", g[*t_it].index);
assert(t_it != topo.rend());
candidate.insert(*t_it++);