From 64e3db3a98a2d5c9577f8783574df2c114f18daa Mon Sep 17 00:00:00 2001 From: NoriteSC <53096989+NoriteSC@users.noreply.github.com> Date: Sat, 13 Jan 2024 17:32:07 +0100 Subject: [PATCH] Update Array.h added IsValidIndex --- Source/Engine/Core/Collections/Array.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/Engine/Core/Collections/Array.h b/Source/Engine/Core/Collections/Array.h index a8390f051..9c50c5ccf 100644 --- a/Source/Engine/Core/Collections/Array.h +++ b/Source/Engine/Core/Collections/Array.h @@ -737,7 +737,18 @@ public: ::Swap(other, *this); } } - + + /// + /// Determines if is valid index. + /// + /// The index. + /// + /// true if is valid a index; otherwise, false. + /// + bool IsValidIndex(int index) const + { + return index < _count && index >= 0; + } /// /// Reverses the order of the added items in the collection. ///