Commit 2d0ac3eb authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

* src/tgbaalgos/simulation.cc (get_state): Do not lookup the map twice.

parent ebe2362b
...@@ -121,24 +121,21 @@ namespace spot ...@@ -121,24 +121,21 @@ namespace spot
inline unsigned inline unsigned
get_state(const state* s) get_state(const state* s)
{ {
if (state2int.find(s) == state2int.end()) map_state_unsigned::const_iterator i = state2int.find(s);
if (i == state2int.end())
{ {
state2int[s] = ++current_max; i = state2int.insert(std::make_pair(s, ++current_max)).first;
previous_class_[out_->add_state(current_max)] = bddfalse; previous_class_[out_->add_state(current_max)] = bddfalse;
} }
return i->second;
return state2int[s];
} }
void process_link(const state* in_s, void process_link(const state* in_s,
int in, int,
const state* out_s, const state* out_s,
int out, int,
const tgba_succ_iterator* si) const tgba_succ_iterator* si)
{ {
(void) in;
(void) out;
int src = get_state(in_s); int src = get_state(in_s);
int dst = get_state(out_s); int dst = get_state(out_s);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment