Helper function to count the number of non-empty elements in a validated array.
Danger: This is only safe to call if the input arrays have been "validated" (dense lhs, empty rhs).
- All elements before the first empty element are non-empty
- All elements after and including the first empty element are empty
- The array forms a contiguous sequence of non-empty elements followed by empty elements
This function assumes that array1 and array2 contain no more than N non-empty elements between them,
if this is not the case then elements from the end of array2 will be dropped.
Danger: This is only safe to call if the input arrays have been "validated" (dense lhs, empty rhs).
Asserts that all fields in input after the first in_len fields are zero.
Copies up to num_items_to_copy items from array2 into array1, starting at start_index, and returns a new
array with the modifications.
Helper function to find the index of the first element in an array that satisfies a given predicate.
If the element is not found, the function returns the length of the array N
Helper function to find the index of the last element in an array that satisfies a given predicate.
If the element is not found, the function returns the length of the array N
Sorts the input array, but also outputs an original_index field for each sorted
item, so that you know where it came from.
Helper fn to create a subarray from a given array.