Revert "[Tizen] Prevent accessing invalid index"
authorEverLEEst(SangHyeon Lee) <sh10233.lee@samsung.com>
Wed, 8 Dec 2021 05:29:26 +0000 (14:29 +0900)
committerEverLEEst(SangHyeon Lee) <sh10233.lee@samsung.com>
Wed, 8 Dec 2021 05:29:26 +0000 (14:29 +0900)
This reverts commit 0fde84c381dc73505ed8b229201ab9b278530eb8.

dali/public-api/common/dali-vector.h

index 471e8b4..80c6364 100644 (file)
@@ -555,11 +555,7 @@ public: // API
   const ItemType& operator[](SizeType index) const
   {
     DALI_ASSERT_VECTOR(VectorBase::mData && "Vector is empty");
-    if(index >= VectorBase::Count())
-    {
-      // Prevent accessing invalid index
-      index = 0;
-    }
+    DALI_ASSERT_VECTOR(index < VectorBase::Count() && "Index out of bounds");
     ItemType* address = reinterpret_cast<ItemType*>(VectorBase::mData);
     address += index;
     return *address;