mirror of https://github.com/axmolengine/axmol.git
Fix ccCArray
This commit is contained in:
parent
c4965f8ca5
commit
8b55f1285f
|
@ -101,12 +101,12 @@ void ccArrayShrink(ccArray *arr)
|
|||
unsigned int ccArrayGetIndexOfObject(ccArray *arr, CCObject* object)
|
||||
{
|
||||
const unsigned int arrNum = arr->num;
|
||||
const CCObject* ptr = arr->arr[0];
|
||||
CCObject** ptr = arr->arr;
|
||||
for(unsigned int i = 0; i < arrNum; ++i, ++ptr)
|
||||
{
|
||||
if( ptr == object ) return i;
|
||||
if( *ptr == object ) return i;
|
||||
}
|
||||
|
||||
|
||||
return CC_INVALID_INDEX;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue