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

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
parent 09242d3f
// -*- coding: utf-8 -*-
// Copyright (C) 2009, 2010, 2011, 2012, 2013 Laboratoire de Recherche
// et Développement de l'Epita (LRDE).
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Laboratoire de
// Recherche et Développement de l'Epita (LRDE).
//
// 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.
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 (child_list::const_iterator i = other.children.begin();
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)
(*i)->succ_create(condition, cache_transition);
......
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