Skip to content

Commit

Permalink
fast access to record
Browse files Browse the repository at this point in the history
  • Loading branch information
Ukendio committed Nov 14, 2024
1 parent 8a03dd2 commit a850d0b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/init.luau
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,10 @@ local function archetype_move(entity_index: EntityIndex, to: Archetype, dst_row:
src_entities[moved] = nil :: any
dst_entities[dst_row] = e1

local record1 = entity_index_try_get_any(entity_index, e1)
local record2 = entity_index_try_get_any(entity_index, e2)
local sparse_array = entity_index.sparse_array

local record1 = sparse_array[ECS_ENTITY_T_LO(e1)]
local record2 = sparse_array[ECS_ENTITY_T_LO(e2)]
record1.row = dst_row
record2.row = src_row
end
Expand Down

0 comments on commit a850d0b

Please sign in to comment.