From 108fb6c41b68a4571d8b883b8a1f60454f982f99 Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Mon, 5 Aug 2024 11:17:26 +0800 Subject: [PATCH] simple rafactoring --- src/Executors/EcsWhereExecutor.cs | 4 ++++ src/Executors/EcsWhereToGroupExecutor.cs | 4 ++++ src/Executors/Queries.cs | 8 -------- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Executors/EcsWhereExecutor.cs b/src/Executors/EcsWhereExecutor.cs index a2d89ce..8a9326b 100644 --- a/src/Executors/EcsWhereExecutor.cs +++ b/src/Executors/EcsWhereExecutor.cs @@ -56,6 +56,10 @@ namespace DCFApixels.DragonECS if (span.IsNull) { Throw.ArgumentNull(nameof(span)); } if (span.WorldID != WorldID) { Throw.Quiery_ArgumentDifferentWorldsException(); } #endif + if (World.IsEnableReleaseDelEntBuffer) + { + World.ReleaseDelEntityBufferAll(); + } EcsSpan result; if (_lastWorldVersion != World.Version) { diff --git a/src/Executors/EcsWhereToGroupExecutor.cs b/src/Executors/EcsWhereToGroupExecutor.cs index e9e280c..df492cc 100644 --- a/src/Executors/EcsWhereToGroupExecutor.cs +++ b/src/Executors/EcsWhereToGroupExecutor.cs @@ -58,6 +58,10 @@ namespace DCFApixels.DragonECS if (span.IsNull) { Throw.ArgumentNull(nameof(span)); } if (span.WorldID != WorldID) { Throw.Quiery_ArgumentDifferentWorldsException(); } #endif + if (World.IsEnableReleaseDelEntBuffer) + { + World.ReleaseDelEntityBufferAll(); + } if (_lastWorldVersion != World.Version) { _aspect.GetIteratorFor(span).CopyTo(_filteredGroup); diff --git a/src/Executors/Queries.cs b/src/Executors/Queries.cs index 9e3f9ee..bbed589 100644 --- a/src/Executors/Queries.cs +++ b/src/Executors/Queries.cs @@ -22,10 +22,6 @@ where TAspect : EcsAspect, new() { EcsWorld world = span.World; - if (world.IsEnableReleaseDelEntBuffer) - { - world.ReleaseDelEntityBufferAll(); - } var executor = world.GetExecutor>(); aspect = executor.Aspect; return executor.ExecuteFor(span); @@ -48,10 +44,6 @@ where TAspect : EcsAspect, new() { EcsWorld world = span.World; - if (world.IsEnableReleaseDelEntBuffer) - { - world.ReleaseDelEntityBufferAll(); - } var executor = world.GetExecutor>(); aspect = executor.Aspect; return executor.ExecuteFor(span);