aztec-nr - noir_aztec::protocol::utils::arrays

Function get_sorted_tuples

pub unconstrained fn get_sorted_tuples<T, let N: u32, Env>(
    array: [T; N],
    ordering: fn[Env](T, T) -> bool,
) -> [SortedTuple<T>; N]
where T: Eq

Sorts the input array, but also outputs an original_index field for each sorted item, so that you know where it came from.