summaryrefslogtreecommitdiff
path: root/lib/gras_impl/block_actor.hpp
diff options
context:
space:
mode:
authorJosh Blum2012-11-18 19:23:17 -0800
committerJosh Blum2012-11-18 19:23:17 -0800
commiteaaf23409d7748409a343a39eb8087216057d3da (patch)
tree8f6a3e4c5a667f8f359defe87c2f79b6b2c4796f /lib/gras_impl/block_actor.hpp
parent308a2403b23888c3f1d2b1ff3b579c1b17450cf1 (diff)
downloadsandhi-eaaf23409d7748409a343a39eb8087216057d3da.tar.gz
sandhi-eaaf23409d7748409a343a39eb8087216057d3da.tar.bz2
sandhi-eaaf23409d7748409a343a39eb8087216057d3da.zip
improvements to done logic (helps reserve 0 case)
Diffstat (limited to 'lib/gras_impl/block_actor.hpp')
-rw-r--r--lib/gras_impl/block_actor.hpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/gras_impl/block_actor.hpp b/lib/gras_impl/block_actor.hpp
index 7c53a08..27f8400 100644
--- a/lib/gras_impl/block_actor.hpp
+++ b/lib/gras_impl/block_actor.hpp
@@ -95,17 +95,10 @@ struct BlockActor : Apology::Worker
void produce_buffer(const size_t index, const SBuffer &buffer);
void flush_output(const size_t index);
- GRAS_FORCE_INLINE bool any_inputs_done(void)
+ GRAS_FORCE_INLINE bool is_input_done(const size_t i)
{
- if (this->inputs_done.none() or this->input_queues.all_ready()) return false;
- for (size_t i = 0; i < this->get_num_inputs(); i++)
- {
- if (this->inputs_done[i] and not this->input_queues.ready(i))
- {
- return true;
- }
- }
- return false;
+ const bool available = this->input_queues.ready(i) and not this->input_queues.empty(i);
+ return this->inputs_done[i] and not available;
}
//per port properties