lemon/core.h
branch1.0
changeset 417 a5cb98ee8d91
parent 398 32fb28fc9d42
child 427 c59bdcc8e33e
     1.1 --- a/lemon/core.h	Mon Apr 12 16:49:51 2010 +0200
     1.2 +++ b/lemon/core.h	Fri Jun 25 06:03:25 2010 +0200
     1.3 @@ -384,6 +384,7 @@
     1.4        template <typename From, typename NodeRefMap, typename ArcRefMap>
     1.5        static void copy(const From& from, Digraph &to,
     1.6                         NodeRefMap& nodeRefMap, ArcRefMap& arcRefMap) {
     1.7 +        to.clear();
     1.8          for (typename From::NodeIt it(from); it != INVALID; ++it) {
     1.9            nodeRefMap[it] = to.addNode();
    1.10          }
    1.11 @@ -411,6 +412,7 @@
    1.12        template <typename From, typename NodeRefMap, typename EdgeRefMap>
    1.13        static void copy(const From& from, Graph &to,
    1.14                         NodeRefMap& nodeRefMap, EdgeRefMap& edgeRefMap) {
    1.15 +        to.clear();
    1.16          for (typename From::NodeIt it(from); it != INVALID; ++it) {
    1.17            nodeRefMap[it] = to.addNode();
    1.18          }