From 506b7e70f61a981618d11cec5b0c86ed523242b4 Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Thu, 22 Jun 2023 14:40:11 +0800 Subject: [PATCH] refactoring --- src/Utils/ArrayUtility.cs | 5 +---- src/Utils/IdsLinkedList.cs | 6 +++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Utils/ArrayUtility.cs b/src/Utils/ArrayUtility.cs index 24406d7..90b3a04 100644 --- a/src/Utils/ArrayUtility.cs +++ b/src/Utils/ArrayUtility.cs @@ -1,7 +1,4 @@ -using System; -using System.Runtime.InteropServices; - -namespace DCFApixels.DragonECS.Relations.Utils +namespace DCFApixels.DragonECS.Relations.Utils { internal static class ArrayUtility { diff --git a/src/Utils/IdsLinkedList.cs b/src/Utils/IdsLinkedList.cs index d451cd0..ec25759 100644 --- a/src/Utils/IdsLinkedList.cs +++ b/src/Utils/IdsLinkedList.cs @@ -53,7 +53,7 @@ namespace DCFApixels.DragonECS.Relations.Utils /// new node index 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];