From ba44b0094374f43d68cf3e2e2cea937c3a0e6c73 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Thu, 13 Apr 2023 09:58:29 +0200 Subject: [PATCH] refactor: :test_tube: add debug output of how long the search took TODO: Revert me! --- lib/comfpile/core.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/comfpile/core.rb b/lib/comfpile/core.rb index dd9f03c..73c28c8 100644 --- a/lib/comfpile/core.rb +++ b/lib/comfpile/core.rb @@ -89,8 +89,13 @@ module Comfpile end def processing_stack_find_next() + i = 0 @processing_stack.reverse_each do |a| - return a if a.waiting? + i += 1 + if a.waiting? + puts "DBG - Found item after #{i} checks" + return a + end end nil