export function growUint32(buffer, required) {
    let capacity = Math.max(buffer.length, 1);
    while (capacity < required) {
        capacity *= 2;
    }
    const next = new Uint32Array(capacity);
    next.set(buffer);
    return next;
}
export function appendPackedCellIndex(indices, cellIndex) {
    for (let index = 0; index < indices.length; index += 1) {
        if (indices[index] === cellIndex) {
            return indices;
        }
    }
    const next = new Uint32Array(indices.length + 1);
    next.set(indices);
    next[indices.length] = cellIndex;
    return next;
}
//# sourceMappingURL=engine-buffer-utils.js.map