Skip to content

Commit 26d9b13

Browse files
committed
Minetest: Boxes: pairs -> ipairs
Proposed by Gregor Parzefall in 1d2b103
1 parent 2eaaca5 commit 26d9b13

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

minetest/boxes.lua

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-- Localize globals
2-
local assert, ipairs, math, minetest, pairs, table, type, vector
3-
= assert, ipairs, math, minetest, pairs, table, type, vector
2+
local assert, ipairs, math, minetest, table, type, vector
3+
= assert, ipairs, math, minetest, table, type, vector
44

55
-- Set environment
66
local _ENV = ...
@@ -48,7 +48,7 @@ local function get_node_boxes(pos, type)
4848
if box_type == "leveled" then
4949
boxes = table.copy(boxes)
5050
local level = (paramtype2 == "leveled" and node.param2 or node_def.leveled or 0) / 255 - 0.5
51-
for _, box in pairs(boxes) do
51+
for _, box in ipairs(boxes) do
5252
box[5] = level
5353
end
5454
elseif box_type == "wallmounted" then
@@ -92,7 +92,7 @@ local function get_node_boxes(pos, type)
9292
matchers[i] = nodename_matcher(nodename_or_group)
9393
end
9494
local function connects_to(nodename)
95-
for _, matcher in pairs(matchers) do
95+
for _, matcher in ipairs(matchers) do
9696
if matcher(nodename) then
9797
return true
9898
end
@@ -130,7 +130,7 @@ local function get_node_boxes(pos, type)
130130
if axis == 2 then
131131
sin = -sin
132132
end
133-
for _, box in pairs(boxes) do
133+
for _, box in ipairs(boxes) do
134134
for off = 0, 3, 3 do
135135
local axis_1, axis_2 = other_axis_1 + off, other_axis_2 + off
136136
local value_1, value_2 = box[axis_1], box[axis_2]

0 commit comments

Comments
 (0)