Array.shrink

Resizes the array to a smaller size.

Arguments

newSize
is the new size of the array, an integer number. If it is greater than the old one, the method has no effect.

Return values

None

Complexity

O(diff), where diff is the difference between the old size and the new size.

Example

"sl/array" useFile a: (1 2 0 5 "Hello" 0.3) makeArray; a [print "," print TRUE] enum 3 a.shrink LF print a [print "," print TRUE] enum
Output:
1,2,0,5,Hello,0.300000, 1,2,0,