Revert "[Tizen] Prevent accessing invalid index"
authordongsug.song <dongsug.song@samsung.com>
Mon, 22 Nov 2021 07:35:25 +0000 (16:35 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Mon, 22 Nov 2021 07:35:25 +0000 (16:35 +0900)
This reverts commit 648e934287d6bf7863c0c330d5052f0a34019771.

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

index b461e1e..fd4565e 100644 (file)
@@ -548,11 +548,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;