diff --git a/src/EcsMask.cs b/src/EcsMask.cs index 4e6a2db..31dbfb1 100644 --- a/src/EcsMask.cs +++ b/src/EcsMask.cs @@ -643,7 +643,7 @@ namespace DCFApixels.DragonECS if (_sortIncChunckBuffer.Length > 1) { - ArraySortUtility.Sort(sortIncBuffer.AsSpan(), new IncCountComparer(counts)); + SortHalper.Sort(sortIncBuffer.AsSpan(), new IncCountComparer(counts)); ConvertToChuncks(preSortingBuffer, sortIncBuffer, _sortIncChunckBuffer); } if (_sortIncChunckBuffer.Length > 0) @@ -657,7 +657,7 @@ namespace DCFApixels.DragonECS if (_sortExcChunckBuffer.Length > 1) { - ArraySortUtility.Sort(sortExcBuffer.AsSpan(), new ExcCountComparer(counts)); + SortHalper.Sort(sortExcBuffer.AsSpan(), new ExcCountComparer(counts)); ConvertToChuncks(preSortingBuffer, sortExcBuffer, _sortExcChunckBuffer); } // Выражение IncCount < (AllEntitesCount - ExcCount) мало вероятно будет истинным. @@ -667,7 +667,7 @@ namespace DCFApixels.DragonECS if (_sortAnyChunckBuffer.Length > 1) { - ArraySortUtility.Sort(sortAnyBuffer.AsSpan(), new ExcCountComparer(counts)); + SortHalper.Sort(sortAnyBuffer.AsSpan(), new ExcCountComparer(counts)); ConvertToChuncks(preSortingBuffer, sortAnyBuffer, _sortAnyChunckBuffer); } // Any не влияет на maxEntites если есть Inc и сложно высчитывается если нет Inc diff --git a/src/Executors/EcsWhereExecutor.cs b/src/Executors/EcsWhereExecutor.cs index 8889fd2..529bfd0 100644 --- a/src/Executors/EcsWhereExecutor.cs +++ b/src/Executors/EcsWhereExecutor.cs @@ -146,7 +146,7 @@ namespace DCFApixels.DragonECS.Core.Internal public EcsUnsafeSpan Execute(Comparison comparison) { Execute_Iternal(); - ArraySortUtility.Sort(_filteredAllEntities.AsSpan(_filteredAllEntitiesCount), comparison); + SortHalper.Sort(_filteredAllEntities.AsSpan(_filteredAllEntitiesCount), comparison); return new EcsUnsafeSpan(World.ID, _filteredAllEntities.Ptr, _filteredAllEntitiesCount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -157,7 +157,7 @@ namespace DCFApixels.DragonECS.Core.Internal return Execute(comparison); } ExecuteFor_Iternal(source); - ArraySortUtility.Sort(_filteredEntities.AsSpan(_filteredEntitiesCount), comparison); + SortHalper.Sort(_filteredEntities.AsSpan(_filteredEntitiesCount), comparison); return new EcsUnsafeSpan(World.ID, _filteredEntities.Ptr, _filteredEntitiesCount); } #endregion diff --git a/src/Internal/ArraySortUtility.cs b/src/Internal/SortHalper.cs similarity index 95% rename from src/Internal/ArraySortUtility.cs rename to src/Internal/SortHalper.cs index b1cd975..0b9a619 100644 --- a/src/Internal/ArraySortUtility.cs +++ b/src/Internal/SortHalper.cs @@ -15,7 +15,7 @@ namespace DCFApixels.DragonECS.Core.Internal [Il2CppSetOption(Option.NullChecks, false)] [Il2CppSetOption(Option.ArrayBoundsChecks, false)] #endif - internal static unsafe class ArraySortUtility + internal static unsafe class SortHalper { internal static StructComparison ToStruct(this Comparison self) { @@ -28,27 +28,27 @@ namespace DCFApixels.DragonECS.Core.Internal public static void Sort(Span span) { var c = Comparer.Default.ToStruct(); - ArraySortUtility>.Sort(span, ref c); + SortHalper>.Sort(span, ref c); } public static void Sort(Span span, Comparer comparer) { var c = comparer.ToStruct(); - ArraySortUtility>.Sort(span, ref c); + SortHalper>.Sort(span, ref c); } public static void Sort(Span span, Comparison comparison) { var c = comparison.ToStruct(); - ArraySortUtility>.Sort(span, ref c); + SortHalper>.Sort(span, ref c); } public static void Sort(Span span, ref TComparer comparer) where TComparer : struct, IComparer { - ArraySortUtility.Sort(span, ref comparer); + SortHalper.Sort(span, ref comparer); } public static void Sort(Span span, TComparer comparer) where TComparer : struct, IComparer { - ArraySortUtility.Sort(span, ref comparer); + SortHalper.Sort(span, ref comparer); } @@ -139,7 +139,7 @@ namespace DCFApixels.DragonECS.Core.Internal [Il2CppSetOption(Option.NullChecks, false)] [Il2CppSetOption(Option.ArrayBoundsChecks, false)] #endif - internal static class ArraySortUtility + internal static class SortHalper where TComparer : struct, IComparer { private const int IntrosortSizeThreshold = 16; @@ -209,7 +209,7 @@ namespace DCFApixels.DragonECS.Core.Internal //Debug.Assert(comparer != null); if (keys.Length > 1) { - IntroSort(keys, 2 * (ArraySortUtility.Log2((uint)keys.Length) + 1), ref comparer); + IntroSort(keys, 2 * (SortHalper.Log2((uint)keys.Length) + 1), ref comparer); } }