Function addCompactedElementCount32State

  • Add a single item to the compacted elements count that would result from using the 32-bit index compaction across the supplied span, but using a retained state machine so it can be done incrementally.

    It is expected the elements are in ascending order.

    Use this to determine the buffer size to allocate.

    stateBuffer needs at least 2 elements at stateBufferOffset.

    Parameters

    • value: number
    • stateBuffer: Int32Array
    • stateBufferOffset: number = 0

    Returns number

    The current count.