if(number)
st.push_back((DataFile::Statement("number"), number));
- set<unsigned> block_ids;
- for(TrackSet::const_iterator i=tracks.begin(); i!=tracks.end(); ++i)
- block_ids.insert((*i)->get_block().get_id());
-
- for(set<unsigned>::const_iterator i=block_ids.begin(); i!=block_ids.end(); ++i)
- st.push_back((DataFile::Statement("block"), *i));
+ unsigned last_block = 0;
+ TrackIter iter = ends[0].reverse();
+ while(iter && tracks.count(iter.track()))
+ {
+ unsigned block_id = iter->get_block().get_id();
+ if(block_id!=last_block)
+ {
+ st.push_back((DataFile::Statement("block"), block_id));
+ last_block = block_id;
+ }
+
+ iter = next_iter(iter);
+ }
}
DataFile::Statement Zone::save_reference() const
void Zone::Loader::block(unsigned b)
{
Block &blk = obj.layout.get_block(b);
- const set<Track *> &btracks = blk.get_tracks();
- obj.tracks.insert(btracks.begin(), btracks.end());
+ obj.add_tracks(blk.get_tracks());
}
} // namespace R2C2