From eaaf23409d7748409a343a39eb8087216057d3da Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 18 Nov 2012 19:23:17 -0800 Subject: improvements to done logic (helps reserve 0 case) --- lib/gras_impl/block_actor.hpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'lib/gras_impl/block_actor.hpp') 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 -- cgit