mirror of
https://github.com/Ukendio/jecs.git
synced 2026-05-13 14:24:14 +00:00
black magic (inlined most of the function calls in iterator - yes it still passes tests)
This commit is contained in:
parent
3150a8bd7a
commit
a062172a9b
1 changed files with 3 additions and 3 deletions
|
|
@ -3340,15 +3340,15 @@ local function world_new(DEBUG: boolean?)
|
||||||
local nth = idr.records[archetype_id]
|
local nth = idr.records[archetype_id]
|
||||||
local end_count = nth + count
|
local end_count = nth + count
|
||||||
|
|
||||||
local entity_idx = world.entity_index
|
|
||||||
local archetype_types = archetype.types
|
local archetype_types = archetype.types
|
||||||
|
local sparse_array = entity_index.sparse_array
|
||||||
|
local dense_array = entity_index.dense_array
|
||||||
|
|
||||||
return function(): i53?
|
return function(): i53?
|
||||||
if nth == end_count then
|
if nth == end_count then
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
local target = entity_index_get_alive(entity_idx,
|
local target = dense_array[sparse_array[ECS_ID(ECS_PAIR_SECOND(archetype_types[nth]))].dense]
|
||||||
ECS_PAIR_SECOND(archetype_types[nth]))
|
|
||||||
nth += 1
|
nth += 1
|
||||||
return target
|
return target
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue