// Given a list of term_scorers and a `ord` and assuming that `term_scorers[ord]` is sorted
// except term_scorers[ord] that might be in advance compared to its ranks,
// bubble up term_scorers[ord] in order to restore the ordering.
Given a list of term_scorers and a `ord` and assuming that `term_scorers[ord]` is sorted
except term_scorers[ord] that might be in advance compared to its ranks,
bubble up term_scorers[ord] in order to restore the ordering.
Given a list of term_scorers and a ` ord ` and assuming that ` term_scorers [ ord ] ` is sorted except term_scorers [ ord ] that might be in advance compared to its ranks bubble up term_scorers [ ord ] in order to restore the ordering .
fn restore_ordering(term_scorers: &mut Vec<TermScorerWithMaxScore>, ord: usize) {
    let doc = term_scorers[ord].doc();
    for i in ord + 1..term_scorers.len() {
        if term_scorers[i].doc() >= doc {
            break;
        }
        term_scorers.swap(i, i - 1);
    }
    debug_assert!(is_sorted(term_scorers.iter().map(|scorer| scorer.doc())));
}
fn restore_ordering ( term_scorers : & mut Vec < TermScorerWithMaxScore > , ord : usize ) { let doc = term_scorers [ ord ] . doc ( ) ; for i in ord + 1 .. term_scorers . len ( ) { if term_scorers [ i ] . doc ( ) >= doc { break ; } term_scorers . swap ( i , i - 1 ) ; } debug_assert ! ( is_sorted ( term_scorers iter ( ) map ( scorer scorer doc ( ) ) ) ) ; }
Given a list of term_scorers and a `ord` and assuming that `term_scorers[ord]` is sorted
except term_scorers[ord] that might be in advance compared to its ranks,
bubble up term_scorers[ord] in order to restore the ordering.
Given a list of term_scorers and a ` ord ` and assuming that ` term_scorers [ ord ] ` is sorted except term_scorers [ ord ] that might be in advance compared to its ranks bubble up term_scorers [ ord ] in order to restore the ordering .
term_scorers
&mut Vec<TermScorerWithMaxScore>
ord
usize