Skip to content

Commit ff54fb3

Browse files
committed
Reduce indexing
1 parent 87e986b commit ff54fb3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/init.luau

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,8 @@ do
743743
local compatible_archetypes: { Archetype }
744744
local column_indices: { { number} }
745745
local ids: { number }
746+
local tr
747+
local columns
746748

747749
local function world_query_next(): any
748750
local entityId = entities[i]
@@ -752,6 +754,8 @@ do
752754
if not archetype then
753755
return nil
754756
end
757+
tr = column_indices[lastArchetype]
758+
columns = archetype.columns
755759
entities = archetype.entities
756760
i = #entities
757761
entityId = entities[i]
@@ -760,9 +764,6 @@ do
760764
local row = i
761765
i-=1
762766

763-
local columns = archetype.columns
764-
local tr = column_indices[lastArchetype]
765-
766767
if queryLength == 1 then
767768
return entityId, columns[tr[1]][row]
768769
elseif queryLength == 2 then
@@ -1012,6 +1013,8 @@ do
10121013

10131014
entities = archetype.entities
10141015
i = #entities
1016+
tr = column_indices[lastArchetype]
1017+
columns = archetype.columns
10151018

10161019
return it
10171020
end

0 commit comments

Comments
 (0)