Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: xiph/rav1e
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c7c9a5c9f2a1c6c00c7142820820b99ab72d1597
Choose a base ref
..
head repository: xiph/rav1e
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 293957695ad7c85db83262536427faa14fcaee4c
Choose a head ref
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/cdef.rs
5 changes: 2 additions & 3 deletions src/cdef.rs
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ pub(crate) mod rust {
///
/// Panics if `elems` is empty
#[inline]
fn first_max_element(elems: &[i32]) -> (usize, i32) {
fn first_max_element(elems: &[i32; 8]) -> (usize, i32) {
// In case of a tie, the first element must be selected.
let (max_idx, max_value) = elems
.iter()
@@ -307,8 +307,7 @@ pub(crate) mod rust {
fn check_max_element() {
assert_eq!(first_max_element(&[-1, -1, 1, 2, 3, 4, 6, 6]), (6, 6));
assert_eq!(first_max_element(&[-1, -1, 1, 2, 3, 4, 7, 6]), (6, 7));
assert_eq!(first_max_element(&[0, 0]), (0, 0));
assert_eq!(first_max_element(&[8]), (0, 8));
assert_eq!(first_max_element(&[0, 0, 0, 0, 0, 0, 0, 0]), (0, 0));
}
}
}