src/hugo/vector_map.h
changeset 897 ef09eee53b09
parent 891 74589d20dbc3
child 901 69a8e672acb1
     1.1 --- a/src/hugo/vector_map.h	Wed Sep 22 07:32:57 2004 +0000
     1.2 +++ b/src/hugo/vector_map.h	Wed Sep 22 08:04:31 2004 +0000
     1.3 @@ -69,10 +69,6 @@
     1.4      /// The pointer type of the map;
     1.5      typedef typename Container::const_pointer ConstPointerType;
     1.6  
     1.7 -    /** Default constructor for the map.
     1.8 -     */
     1.9 -    VectorMap() {}
    1.10 -		
    1.11      /** Graph and Registry initialized map constructor.
    1.12       */
    1.13      VectorMap(const Graph& g, MapRegistry& r) 
    1.14 @@ -98,8 +94,10 @@
    1.15       */
    1.16      template <typename TT>
    1.17      VectorMap& operator=(const VectorMap<MapRegistry, TT>& c) {
    1.18 -      container.resize(c.container.size());
    1.19 -      MapBase::operator=(c);
    1.20 +      if (MapBase::getGraph() != c.getGraph()) {
    1.21 +	MapBase::operator=(c);
    1.22 +	container.resize(c.container.size());
    1.23 +      }
    1.24        for (KeyIt it(*MapBase::getGraph()); it != INVALID; ++it) {
    1.25  	int id = KeyInfo<Graph, KeyIt>::id(*MapBase::getGraph(), it);
    1.26  	container[id] = c.container[id];