Skip to main content

NewCompactArray

Creates a new CompactArray of specified size.

def NewCompactArray(
size: uint,
maxValue: Item
) - > CompactArray, error

Creates a new CompactArray of specified size.

Parameters

NameTypeDescription
sizeuintThe number of items the CompactArray can hold.
maxValueItemThe maximum value that can be stored in the CompactArray, used to determine the number of bits needed per item.

Returns

TypeDescription
CompactArray, errorA new CompactArray instance or an error if the itemSize is invalid.