refactoring

This commit is contained in:
Mikhail 2023-06-22 14:40:11 +08:00
parent c0d5d02a5d
commit 506b7e70f6
2 changed files with 4 additions and 7 deletions

View File

@ -1,7 +1,4 @@
using System;
using System.Runtime.InteropServices;
namespace DCFApixels.DragonECS.Relations.Utils
namespace DCFApixels.DragonECS.Relations.Utils
{
internal static class ArrayUtility
{

View File

@ -53,7 +53,7 @@ namespace DCFApixels.DragonECS.Relations.Utils
/// <returns> new node index</returns>
public int InsertAfter(int nodeIndex, int value)
{
if(++_count >= _nodes.Length)
if (++_count >= _nodes.Length)
Array.Resize(ref _nodes, _nodes.Length << 1);
int newNodeIndex = _recycledNodesCount > 0 ? _recycledNodes[--_recycledNodesCount] : _count;
@ -67,7 +67,7 @@ namespace DCFApixels.DragonECS.Relations.Utils
return newNodeIndex;
}
public int InsertBefore(int nodeIndex, int value)
public int InsertBefore(int nodeIndex, int value)
{
if (++_count >= _nodes.Length)
Array.Resize(ref _nodes, _nodes.Length << 1);
@ -83,7 +83,7 @@ namespace DCFApixels.DragonECS.Relations.Utils
}
public void Remove(int nodeIndex)
{
if(nodeIndex <= 0)
if (nodeIndex <= 0)
throw new ArgumentOutOfRangeException();
ref var node = ref _nodes[nodeIndex];