From: Mikko Rasa Date: Thu, 7 Nov 2013 20:29:56 +0000 (+0200) Subject: Use simpler logic when dealing with routes in TrackOffsetIter X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=af50f0bdecaf4d08cf13227d092a788c65220845;p=r2c2.git Use simpler logic when dealing with routes in TrackOffsetIter --- diff --git a/source/libr2c2/trackoffsetiter.cpp b/source/libr2c2/trackoffsetiter.cpp index 01fd580..f8e8a2d 100644 --- a/source/libr2c2/trackoffsetiter.cpp +++ b/source/libr2c2/trackoffsetiter.cpp @@ -91,13 +91,7 @@ TrackOffsetIter TrackOffsetIter::advance(float d, const Route *r) const while(t) { if(p<0) - { - if(r) - if(unsigned tid = t->get_turnout_id()) - p = r->get_turnout(tid); - if(p<0) - p = t->get_active_path(); - } + p = (r ? r->get_path(*t) : t->get_active_path()); float length = t->get_type().get_path_length(p); if(o