pub fn take_arrays<I: IntoIterator<Item = MergeSlice>>(
    arrays: &[&dyn Array],
    slices: I,
    limit: Option<usize>,
) -> Box<dyn Array> {
    let slices = slices.into_iter();
    let len = arrays.iter().map(|array| array.len()).sum();

    let limit = limit.unwrap_or(len);
    let limit = limit.min(len);
    let mut growable = make_growable(arrays, false, limit);

    if limit != len {
        let mut current_len = 0;
        for (index, start, len) in slices {
            if len + current_len >= limit {
                growable.extend(index, start, limit - current_len);
                break;
            } else {
                growable.extend(index, start, len);
                current_len += len;
            }
        }
    } else {
        for (index, start, len) in slices {
            growable.extend(index, start, len);
        }
    }

    growable.as_box()
}
/// Takes N arrays together through `slices` under the assumption that the slices have
/// a total coverage of the arrays.
/// I.e. they are such that all elements on all arrays are picked (which is the case in sorting).
/// # Panic
/// This function panics if:
/// * `max(slices[i].0) >= arrays.len()`, as it indicates that the slices point to an array out of bounds from `arrays`.
/// * the arrays do not have the same [`crate::datatypes::DataType`] (as it makes no sense to take together from them)
Takes N arrays together through `slices` under the assumption that the slices have
a total coverage of the arrays.
Takes N arrays together through ` slices ` under the assumption that the slices have a total coverage of the arrays .
pub fn take_arrays<I: IntoIterator<Item = MergeSlice>>(
    arrays: &[&dyn Array],
    slices: I,
    limit: Option<usize>,
) -> Box<dyn Array> {
    let slices = slices.into_iter();
    let len = arrays.iter().map(|array| array.len()).sum();
    let limit = limit.unwrap_or(len);
    let limit = limit.min(len);
    let mut growable = make_growable(arrays, false, limit);
    if limit != len {
        let mut current_len = 0;
        for (index, start, len) in slices {
            if len + current_len >= limit {
                growable.extend(index, start, limit - current_len);
                break;
            } else {
                growable.extend(index, start, len);
                current_len += len;
            }
        }
    } else {
        for (index, start, len) in slices {
            growable.extend(index, start, len);
        }
    }
    growable.as_box()
}
pub fn take_arrays < I : IntoIterator < Item = MergeSlice > > ( arrays : & [ & dyn Array ] , slices : I , limit : Option < usize > , ) -> Box < dyn Array > { let slices = slices . into_iter ( ) ; let len = arrays . iter ( ) . map ( | array | array . len ( ) ) . sum ( ) ; let limit = limit . unwrap_or ( len ) ; let limit = limit . min ( len ) ; let mut growable = make_growable ( arrays , false , limit ) ; if limit != len { let mut current_len = 0 ; for ( index , start , len ) in slices { if len + current_len >= limit { growable . extend ( index , start , limit - current_len ) ; break ; } else { growable . extend ( index , start , len ) ; current_len += len ; } } } else { for ( index , start , len ) in slices { growable . extend ( index , start , len ) ; } } growable . as_box ( ) }
Takes N arrays together through `slices` under the assumption that the slices have
a total coverage of the arrays.
Takes N arrays together through ` slices ` under the assumption that the slices have a total coverage of the arrays .
arrays
&[&dyn Array]
slices
I
limit
Option<usize>
arrays
&[&dyn Array]
slices
I
limit
Option<usize>
panic
This function panics if:
`max(slices[i].0) >= arrays.len()`, as it indicates that the slices point to an array out of bounds from `arrays`.
the arrays do not have the same [`crate::datatypes::DataType`] (as it makes no sense to take together from them)
This function panics if : ` max ( slices [ i ] . 0 ) > = arrays . len () ` as it indicates that the slices point to an array out of bounds from ` arrays ` . the arrays do not have the same [ ` crate :: datatypes :: DataType ` ] ( as it makes no sense to take together from them )