def _merge(iterable1, iterable2):
    """
    Merge two slices into a single ordered one.

    Complexity: O(n),
    Where n = len(iterable1) + len(iterable2)

    :param iterable1:
    :param iterable2:
    :return:
    """
    if not iterable1:
        return iterable2

    if not iterable2:
        return iterable1

    # Now, we iterate both. Since each iterable is already ordered
    # We only need to compare each position and append in the correct order
    n1 = len(iterable1)
    n2 = len(iterable2)

    # Pre-allocate the list to be less expensive than appending
    result = [0] * (n1 + n2)
    i1 = i2 = 0

    for i in range(n1 + n2):
        if i1 >= n1:
            result[i] = iterable2[i2]
            i2 += 1
            continue

        elif i2 >= n2:
            result[i] = iterable1[i1]
            i1 += 1
            continue

        if i2 >= n2 or iterable1[i1] <= iterable2[i2]:
            result[i] = iterable1[i1]
            i1 += 1
        else:
            result[i] = iterable2[i2]
            i2 += 1

    return result