lemon/core.h
branch1.2
changeset 986 e958855b8186
parent 956 141f9c0db4a3
parent 980 bb871cb8ac06
child 1110 02c93d1f00d7
     1.1 --- a/lemon/core.h	Fri Jun 25 05:54:56 2010 +0200
     1.2 +++ b/lemon/core.h	Fri Jun 25 06:20:28 2010 +0200
     1.3 @@ -394,6 +394,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 @@ -421,6 +422,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          }