Corretto check nella remove
git-svn-id: svn://10.65.10.50/trunk@2045 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
658d370f05
commit
f8f0a320f9
@ -266,7 +266,7 @@ TObject* TArray::remove(
|
||||
|
||||
// @rdesc Ritorna l'elemento dell'array eliminato senza farne la delete
|
||||
{
|
||||
CHECKD(index >= 0 && index < _size, "Can't remove array item ", index);
|
||||
CHECKD(index >= 0, "Can't remove array item ", index);
|
||||
|
||||
TObject* o = objptr(index);
|
||||
if (o)
|
||||
@ -276,9 +276,9 @@ TObject* TArray::remove(
|
||||
if (index < _next)
|
||||
_next = index;
|
||||
}
|
||||
if (dopack)
|
||||
if (dopack && index < size())
|
||||
{
|
||||
const int last = _size-1;
|
||||
const int last = size()-1;
|
||||
for (int i = index ; i < last; i++)
|
||||
_data[i] = _data[i+1];
|
||||
_data[last] = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user