aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCalinou <Calinou@users.noreply.github.com>2015-06-14 20:49:41 +0200
committerCalinou <Calinou@users.noreply.github.com>2015-06-14 20:49:41 +0200
commit7da13d56b6c86951ee23f640bf077847532fa0c4 (patch)
tree34a9fe497f00ff3ebb66ba887bf62e591fdf476a
parente8e4316ee6d24852471c273fdd83c9e9d770acfc (diff)
parent68e5b76c90c70e760dfcbc1db84e94e6cdcbf707 (diff)
downloadmoreblocks-7da13d56b6c86951ee23f640bf077847532fa0c4.tar.gz
moreblocks-7da13d56b6c86951ee23f640bf077847532fa0c4.tar.bz2
moreblocks-7da13d56b6c86951ee23f640bf077847532fa0c4.zip
Merge pull request #5 from kilbith/master
Speedup get_output_inv()
-rw-r--r--circular_saw.lua3
1 files changed, 2 insertions, 1 deletions
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