diff options
author | Tim O'Shea <tim.oshea753@gmail.com> | 2014-09-19 12:48:50 -0400 |
---|---|---|
committer | Tim O'Shea <tim.oshea753@gmail.com> | 2014-09-19 12:48:50 -0400 |
commit | 72e3da15f40e9fff5297f5134676063397035423 (patch) | |
tree | 78f771da235d5f68e0e861bbcd94657380d13457 /gnuradio-runtime/lib/buffer.cc | |
parent | 9c4b9fc8af447edb8ad786a9a629e583476c2a3a (diff) |
runtime: speed up all the things
Diffstat (limited to 'gnuradio-runtime/lib/buffer.cc')
-rw-r--r-- | gnuradio-runtime/lib/buffer.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gnuradio-runtime/lib/buffer.cc b/gnuradio-runtime/lib/buffer.cc index 5ab8694862..f2168f4a9c 100644 --- a/gnuradio-runtime/lib/buffer.cc +++ b/gnuradio-runtime/lib/buffer.cc @@ -232,8 +232,7 @@ namespace gr { buffer::remove_item_tag(const tag_t &tag, long id) { gr::thread::scoped_lock guard(*mutex()); -// TODO: we can probably do this more efficiently now ... - for(std::multimap<uint64_t,tag_t>::iterator it = d_item_tags.begin(); it != d_item_tags.end(); ++it) { + for(std::multimap<uint64_t,tag_t>::iterator it = d_item_tags.lower_bound(tag.offset); it != d_item_tags.upper_bound(tag.offset); ++it) { if((*it).second == tag) { (*it).second.marked_deleted.push_back(id); } @@ -326,10 +325,11 @@ namespace gr { gr::thread::scoped_lock guard(*mutex()); v.resize(0); - std::multimap<uint64_t,tag_t>::iterator itr = d_buffer->get_tags_begin(); + std::multimap<uint64_t,tag_t>::iterator itr = d_buffer->get_tags_lower_bound(abs_start); + std::multimap<uint64_t,tag_t>::iterator itr_end = d_buffer->get_tags_upper_bound(abs_end); uint64_t item_time; - while(itr != d_buffer->get_tags_end()) { + while(itr != itr_end) { item_time = (*itr).second.offset + d_attr_delay; //item_time = (*itr).offset + d_attr_delay; |