/**
 * @template T
 * @param {T[]} array
 * @param {number} offset
 * @param {number} distance
 * @param {number} count
 */
export function array_shift_back(array, offset, distance, count) {

    const end = Math.min(array.length, offset + count);

    for (let i = offset; i < end; i++) {

        const target = i - distance;

        array[target] = array[i];

    }

}