mirror of
https://github.com/Ukendio/jecs.git
synced 2025-07-01 12:49:17 +00:00
Improve inlining
This commit is contained in:
parent
8638c04448
commit
3573dc2a85
1 changed files with 7 additions and 8 deletions
15
lib/init.lua
15
lib/init.lua
|
@ -610,13 +610,8 @@ local function destructColumns(columns, count, row)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function archetypeDelete(entityIndex, entityId: i53, destruct: boolean)
|
local function archetypeDelete(entityIndex, record: Record, entityId: i53, destruct: boolean)
|
||||||
local sparse = entityIndex.sparse
|
local sparse, dense = entityIndex.sparse, entityIndex.dense
|
||||||
local dense = entityIndex.dense
|
|
||||||
local record = sparse[entityId]
|
|
||||||
if not record then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local archetype = record.archetype
|
local archetype = record.archetype
|
||||||
local row = record.row
|
local row = record.row
|
||||||
local entities = archetype.entities
|
local entities = archetype.entities
|
||||||
|
@ -647,7 +642,11 @@ end
|
||||||
|
|
||||||
function World.delete(world: World, entityId: i53)
|
function World.delete(world: World, entityId: i53)
|
||||||
local entityIndex = world.entityIndex
|
local entityIndex = world.entityIndex
|
||||||
archetypeDelete(entityIndex, entityId, true)
|
local record = entityIndex.sparse[entityId]
|
||||||
|
if not record then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
archetypeDelete(entityIndex, record, entityId, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
function World.observer(world: World, ...)
|
function World.observer(world: World, ...)
|
||||||
|
|
Loading…
Reference in a new issue