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 09242d3f78
commit 2745381097

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2009, 2010, 2011, 2012, 2013 Laboratoire de Recherche // Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Laboratoire de
// et Développement de l'Epita (LRDE). // Recherche et Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -149,11 +149,9 @@ namespace spot
/// \brief Copy the tree \a other, and set \c marked to false. /// \brief Copy the tree \a other, and set \c marked to false.
safra_tree::safra_tree(const safra_tree& other) safra_tree::safra_tree(const safra_tree& other)
: marked(false) : marked(false), name(other.name), nodes(other.nodes)
{ {
name = other.name;
parent = 0; parent = 0;
nodes = other.nodes;
for (child_list::const_iterator i = other.children.begin(); for (child_list::const_iterator i = other.children.begin();
i != other.children.end(); ++i) i != other.children.end(); ++i)
{ {
@ -376,7 +374,7 @@ namespace spot
} }
} }
} }
nodes = new_subset; std::swap(nodes, new_subset);
for (child_list::iterator i = children.begin(); i != children.end(); ++i) for (child_list::iterator i = children.begin(); i != children.end(); ++i)
(*i)->succ_create(condition, cache_transition); (*i)->succ_create(condition, cache_transition);