Some bug fixes.
authordeba
Tue, 12 Apr 2005 17:34:51 +0000
changeset 1343a81f9cfc9775
parent 1342 e335eebdae5b
child 1344 9146f77f6d67
Some bug fixes.
src/lemon/graph_reader.h
src/lemon/graph_writer.h
     1.1 --- a/src/lemon/graph_reader.h	Tue Apr 12 17:33:41 2005 +0000
     1.2 +++ b/src/lemon/graph_reader.h	Tue Apr 12 17:34:51 2005 +0000
     1.3 @@ -553,7 +553,6 @@
     1.4  	}
     1.5  	vi = line.find_first_not_of(" \t");
     1.6  	if (vi != (int)std::string::npos) { 
     1.7 -	  //	  std::cerr << "Line: " << line.substr(vi) << std::endl;
     1.8  	  return line.substr(vi);
     1.9  	}
    1.10        }
     2.1 --- a/src/lemon/graph_writer.h	Tue Apr 12 17:33:41 2005 +0000
     2.2 +++ b/src/lemon/graph_writer.h	Tue Apr 12 17:34:51 2005 +0000
     2.3 @@ -382,6 +382,7 @@
     2.4  
     2.5      void writeEdgeSet(WriterBase<Node>* nodeWriter, 
     2.6  		      WriterBase<Edge>* & edgeWriter) {
     2.7 +      if (edge_map_writers.size() == 0) return;
     2.8        if (nodeWriter == 0) {
     2.9  	throw DataFormatError("Cannot find node id map");
    2.10        }
    2.11 @@ -406,6 +407,7 @@
    2.12      }
    2.13  
    2.14      void writeNodes(WriterBase<Node>* nodeWriter) {
    2.15 +      if (node_writers.size() == 0) return;
    2.16        if (nodeWriter == 0) {
    2.17  	throw DataFormatError("Cannot find node id map");
    2.18        }
    2.19 @@ -418,6 +420,7 @@
    2.20      }
    2.21  
    2.22      void writeEdges(WriterBase<Edge>* edgeWriter) {
    2.23 +      if (edge_writers.size() == 0) return;
    2.24        if (edgeWriter == 0) {
    2.25  	throw DataFormatError("Cannot find node id map");
    2.26        }