// Return the zero-based index of the first row that breaks ascending order, or minus one when sorted. pub fn first_inversion(items: vector) -> i64 { let mut i = 1; while i