lemon/core.h
changeset 893 d395358592df
parent 883 dc376822c17d
parent 890 bb871cb8ac06
child 919 e0cef67fe565
     1.1 --- a/lemon/core.h	Fri Jun 25 06:00:56 2010 +0200
     1.2 +++ b/lemon/core.h	Fri Jun 25 06:41:55 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          }