From 2d6e6dbdb0606d0b2d4b5778971385b6fcdf6cd1 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 3 Dec 2013 15:32:20 +0800 Subject: [PATCH] issue #2790: Assert fix for Vector::insertObject. --- cocos/base/CCVector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/base/CCVector.h b/cocos/base/CCVector.h index 31554a3c8c..91e21d361a 100644 --- a/cocos/base/CCVector.h +++ b/cocos/base/CCVector.h @@ -199,7 +199,7 @@ public: /** Insert a certain object at a certain index */ void insertObject(T object, long index) { - CCASSERT(index >= 0 && index < count(), "Invalid index!"); + CCASSERT(index >= 0 && index <= count(), "Invalid index!"); _data.insert((std::begin(_data) + index), object); object->retain(); }