tgbasafracomplement: avoid some std::set copies

* src/tgba/tgbasafracomplement.cc: Here.  Beside being more efficient,
the use of std::swap instead of an assignment also protects us from a
bug recently introduced in the development version of G++.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63698
This commit is contained in:
Alexandre Duret-Lutz 2014-10-31 11:47:03 +01:00
parent ad8d24222a
commit b8a792248a

View file

@ -147,11 +147,9 @@ namespace spot
/// \brief Copy the tree \a other, and set \c marked to false.
safra_tree::safra_tree(const safra_tree& other)
: marked(false)
: marked(false), name(other.name), nodes(other.nodes)
{
name = other.name;
parent = 0;
nodes = other.nodes;
for (auto i: other.children)
{
safra_tree* c = new safra_tree(*i);
@ -365,7 +363,7 @@ namespace spot
}
}
}
nodes = new_subset;
std::swap(nodes, new_subset);
for (auto c: children)
c->succ_create(condition, cache_transition);