lemon/core.h
changeset 959 17e36e175725
parent 671 da70af8844b9
parent 890 bb871cb8ac06
child 964 2b6bffe0e7e8
child 993 157427808b40
     1.1 --- a/lemon/core.h	Tue Nov 01 08:24:30 2011 +0100
     1.2 +++ b/lemon/core.h	Tue Dec 20 17:35:45 2011 +0100
     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          }