diff options
author | Calinou <Calinou@users.noreply.github.com> | 2015-06-14 20:49:41 +0200 |
---|---|---|
committer | Calinou <Calinou@users.noreply.github.com> | 2015-06-14 20:49:41 +0200 |
commit | 7da13d56b6c86951ee23f640bf077847532fa0c4 (patch) | |
tree | 34a9fe497f00ff3ebb66ba887bf62e591fdf476a | |
parent | e8e4316ee6d24852471c273fdd83c9e9d770acfc (diff) | |
parent | 68e5b76c90c70e760dfcbc1db84e94e6cdcbf707 (diff) | |
download | moreblocks-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.lua | 3 |
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 |