|
|
@ -96,12 +96,15 @@ public final function ArrayList SetLength(int newLength) |
|
|
|
{ |
|
|
|
{ |
|
|
|
local int i; |
|
|
|
local int i; |
|
|
|
|
|
|
|
|
|
|
|
if (newLength < 0) { |
|
|
|
if (newLength < 0) return self; |
|
|
|
return self; |
|
|
|
if (storedObjects.length == newLength) return self; |
|
|
|
} |
|
|
|
|
|
|
|
for (i = newLength; i < storedObjects.length; i += 1) { |
|
|
|
for (i = newLength; i < storedObjects.length; i += 1) { |
|
|
|
FreeItem(i); |
|
|
|
FreeItem(i); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (storedObjects.length <= 0) { |
|
|
|
|
|
|
|
storedObjects[0] = none; |
|
|
|
|
|
|
|
} |
|
|
|
storedObjects.length = newLength; |
|
|
|
storedObjects.length = newLength; |
|
|
|
return self; |
|
|
|
return self; |
|
|
|
} |
|
|
|
} |
|
|
|