]> git.tdb.fi Git - r2c2.git/commitdiff
Use simpler logic when dealing with routes in TrackOffsetIter
authorMikko Rasa <tdb@tdb.fi>
Thu, 7 Nov 2013 20:29:56 +0000 (22:29 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 7 Nov 2013 20:29:56 +0000 (22:29 +0200)
source/libr2c2/trackoffsetiter.cpp

index 01fd58042b0b5cf916551913994992671656e7d0..f8e8a2d2a4c54a5270c85a41fd5955011c2f9641 100644 (file)
@@ -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<length)