From c76252da2177c36013ac1a0e6840baf75e3d2d88 Mon Sep 17 00:00:00 2001 From: ds5678 <49847914+ds5678@users.noreply.github.com> Date: Sat, 5 Oct 2024 13:42:53 -0700 Subject: [PATCH] Simpler index check --- Il2CppInterop.Runtime/InteropTypes/Arrays/Il2CppArrayBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Il2CppInterop.Runtime/InteropTypes/Arrays/Il2CppArrayBase.cs b/Il2CppInterop.Runtime/InteropTypes/Arrays/Il2CppArrayBase.cs index b9b134ce..4b2c7ec4 100644 --- a/Il2CppInterop.Runtime/InteropTypes/Arrays/Il2CppArrayBase.cs +++ b/Il2CppInterop.Runtime/InteropTypes/Arrays/Il2CppArrayBase.cs @@ -27,7 +27,7 @@ private protected static bool ThrowImmutableLength() private protected void ThrowIfIndexOutOfRange(int index) { - if (index < 0 || index >= Length) + if ((uint)index >= (uint)Length) throw new ArgumentOutOfRangeException(nameof(index), "Array index may not be negative or above length of the array"); }