COIN-OR::LEMON - Graph Library

Changes in / [297:92b193385702:296:9768e60aa4e1] in lemon-main


Ignore:
Location:
lemon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/lgf_reader.h

    r295 r294  
    518518        _use_nodes(false), _use_arcs(false),
    519519        _skip_nodes(false), _skip_arcs(false) {
    520       if (!(*_is)) {
    521         delete _is;
    522         throw IoError("Cannot open file", fn);
    523       }
     520      if (!(*_is)) throw IoError("Cannot open file", fn);
    524521    }
    525522
     
    533530        _use_nodes(false), _use_arcs(false),
    534531        _skip_nodes(false), _skip_arcs(false) {
    535       if (!(*_is)) {
    536         delete _is;
    537         throw IoError("Cannot open file", fn);
    538       }
     532      if (!(*_is)) throw IoError("Cannot open file", fn);
    539533    }
    540534
     
    13151309        _use_nodes(false), _use_edges(false),
    13161310        _skip_nodes(false), _skip_edges(false) {
    1317       if (!(*_is)) {
    1318         delete _is;
    1319         throw IoError("Cannot open file", fn);
    1320       }
     1311      if (!(*_is)) throw IoError("Cannot open file", fn);
    13211312    }
    13221313
     
    13301321        _use_nodes(false), _use_edges(false),
    13311322        _skip_nodes(false), _skip_edges(false) {
    1332       if (!(*_is)) {
    1333         delete _is;
    1334         throw IoError("Cannot open file", fn);
    1335       }
     1323      if (!(*_is)) throw IoError("Cannot open file", fn);
    13361324    }
    13371325
     
    21072095      : _is(new std::ifstream(fn.c_str())), local_is(true),
    21082096        _filename(fn) {
    2109       if (!(*_is)) {
    2110         delete _is;
    2111         throw IoError("Cannot open file", fn);
    2112       }
     2097      if (!(*_is)) throw IoError("Cannot open file", fn);
    21132098    }
    21142099
     
    21192104      : _is(new std::ifstream(fn)), local_is(true),
    21202105        _filename(fn) {
    2121       if (!(*_is)) {
    2122         delete _is;
    2123         throw IoError("Cannot open file", fn);
    2124       }
     2106      if (!(*_is)) throw IoError("Cannot open file", fn);
    21252107    }
    21262108
     
    24052387    LgfContents(const std::string& fn)
    24062388      : _is(new std::ifstream(fn.c_str())), local_is(true) {
    2407       if (!(*_is)) {
    2408         delete _is;
    2409         throw IoError("Cannot open file", fn);
    2410       }
     2389      if (!(*_is)) throw IoError("Cannot open file", fn);
    24112390    }
    24122391
     
    24172396    LgfContents(const char* fn)
    24182397      : _is(new std::ifstream(fn)), local_is(true) {
    2419       if (!(*_is)) {
    2420         delete _is;
    2421         throw IoError("Cannot open file", fn);
    2422       }
     2398      if (!(*_is)) throw IoError("Cannot open file", fn);
    24232399    }
    24242400
  • lemon/lgf_writer.h

    r295 r294  
    464464      : _os(new std::ofstream(fn.c_str())), local_os(true), _digraph(digraph),
    465465        _skip_nodes(false), _skip_arcs(false) {
    466       if (!(*_os)) {
    467         delete _os;
    468         throw IoError("Cannot write file", fn);
    469       }
     466      if (!(*_os)) throw IoError("Cannot write file", fn);
    470467    }
    471468
     
    477474      : _os(new std::ofstream(fn)), local_os(true), _digraph(digraph),
    478475        _skip_nodes(false), _skip_arcs(false) {
    479       if (!(*_os)) {
    480         delete _os;
    481         throw IoError("Cannot write file", fn);
    482       }
     476      if (!(*_os)) throw IoError("Cannot write file", fn);
    483477    }
    484478
     
    10311025      : _os(new std::ofstream(fn.c_str())), local_os(true), _graph(graph),
    10321026        _skip_nodes(false), _skip_edges(false) {
    1033       if (!(*_os)) {
    1034         delete _os;
    1035         throw IoError("Cannot write file", fn);
    1036       }
     1027      if (!(*_os)) throw IoError("Cannot write file", fn);
    10371028    }
    10381029
     
    10441035      : _os(new std::ofstream(fn)), local_os(true), _graph(graph),
    10451036        _skip_nodes(false), _skip_edges(false) {
    1046       if (!(*_os)) {
    1047         delete _os;
    1048         throw IoError("Cannot write file", fn);
    1049       }
     1037      if (!(*_os)) throw IoError("Cannot write file", fn);
    10501038    }
    10511039
     
    16001588    SectionWriter(const std::string& fn)
    16011589      : _os(new std::ofstream(fn.c_str())), local_os(true) {
    1602       if (!(*_os)) {
    1603         delete _os;
    1604         throw IoError("Cannot write file", fn);
    1605       }
     1590      if (!(*_os)) throw IoError("Cannot write file", fn);
    16061591    }
    16071592
     
    16111596    SectionWriter(const char* fn)
    16121597      : _os(new std::ofstream(fn)), local_os(true) {
    1613       if (!(*_os)) {
    1614         delete _os;
    1615         throw IoError("Cannot write file", fn);
    1616       }
     1598      if (!(*_os)) throw IoError("Cannot write file", fn);
    16171599    }
    16181600
Note: See TracChangeset for help on using the changeset viewer.