X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Flayout.cpp;h=a55819bdb3db2763abc7825a8b6fc6121fbac426;hb=247742fbc1c27bfc9fdef4630afcdc2408cdd550;hp=3e49f19b836fa56351f4b42439e9be6b00e588be;hpb=90f9efba8d88f41c7a180734b7bcbdd1501d995e;p=r2c2.git diff --git a/source/libr2c2/layout.cpp b/source/libr2c2/layout.cpp index 3e49f19..a55819b 100644 --- a/source/libr2c2/layout.cpp +++ b/source/libr2c2/layout.cpp @@ -84,7 +84,7 @@ void Layout::remove_track(Track &t) } } -unsigned Layout::allocate_turnout_id(bool dbl) +unsigned Layout::allocate_turnout_id() { set used_ids; for(set::const_iterator i=tracks.begin(); i!=tracks.end(); ++i) @@ -92,9 +92,9 @@ unsigned Layout::allocate_turnout_id(bool dbl) used_ids.insert((*i)->get_turnout_id()); unsigned result = next_turnout_id; - while(used_ids.count(result) || (dbl && used_ids.count(result+1))) + while(used_ids.count(result)) ++result; - next_turnout_id = result+1+dbl; + next_turnout_id = result+1; return result; }