]> git.tdb.fi Git - r2c2.git/commitdiff
Don't save an allocated but pending block
authorMikko Rasa <tdb@tdb.fi>
Fri, 20 Feb 2015 09:58:42 +0000 (11:58 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 20 Feb 2015 09:58:42 +0000 (11:58 +0200)
It could be a failed turnout which is still set the wrong way.

source/libr2c2/blockallocator.cpp

index 79274b77ded54cd6df67fb7e38329e36a2a4b03a..7cca79f795a61c9cad6ad11eb2689639f4574098 100644 (file)
@@ -587,7 +587,7 @@ void BlockAllocator::save(list<DataFile::Statement> &st) const
 
                st.push_back((DataFile::Statement("hint"), prev->get_id()));
 
-               for(BlockList::const_iterator i=cur_blocks.begin(); i!=cur_blocks.end(); ++i)
+               for(BlockList::const_iterator i=cur_blocks.begin(); (i!=cur_blocks.end() && i->block()!=pending_block); ++i)
                        st.push_back((DataFile::Statement("block"), (*i)->get_id()));
        }
 }