From e95a6225a7407a96d1f8f86862d333c8e74031fe Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Sun, 16 Mar 2025 14:12:23 +0800 Subject: [PATCH] Update EcsPool.cs --- src/Pools/EcsPool.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Pools/EcsPool.cs b/src/Pools/EcsPool.cs index 648af29..92ab48b 100644 --- a/src/Pools/EcsPool.cs +++ b/src/Pools/EcsPool.cs @@ -396,14 +396,15 @@ namespace DCFApixels.DragonECS #endif _isDenseEntitiesDelayedValid = true; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] private int GetFreeItemIndex(int entityID) { - if (_denseEntitiesDelayedCount >= _capacity - 1) + if (_denseEntitiesDelayedCount >= _capacity) { UpdateDenseEntities(); } - if (_itemsCount >= _capacity - 1) + if (_itemsCount + 1 >= _capacity) { Resize(_items.Length << 1); }