From 68e5b76c90c70e760dfcbc1db84e94e6cdcbf707 Mon Sep 17 00:00:00 2001 From: kilbith Date: Sun, 14 Jun 2015 20:42:23 +0200 Subject: Speedup get_output_inv() --- circular_saw.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/circular_saw.lua b/circular_saw.lua index 4735dcd..142a95f 100644 --- a/circular_saw.lua +++ b/circular_saw.lua @@ -91,7 +91,8 @@ function circular_saw:get_output_inv(modname, material, amount, max) return list end - for i, t in ipairs(circular_saw.names) do + for i = 1, #circular_saw.names do + local t = circular_saw.names[i] local cost = circular_saw.cost_in_microblocks[i] local balance = math.min(math.floor(amount/cost), max) pos = pos + 1 -- cgit v1.2.3