fn align_scorers(
    term_scorers: &mut Vec<TermScorerWithMaxScore>,
    pivot_doc: DocId,
    before_pivot_len: usize,
) -> bool {
    debug_assert_ne!(pivot_doc, TERMINATED);
    for i in (0..before_pivot_len).rev() {
        let new_doc = term_scorers[i].seek(pivot_doc);
        if new_doc != pivot_doc {
            if new_doc == TERMINATED {
                term_scorers.swap_remove(i);
            }
            // We went past the pivot.
            // We just go through the outer loop mechanic (Note that pivot is
            // still a possible candidate).
            //
            // Termination is still guaranteed since we can only consider the same
            // pivot at most term_scorers.len() - 1 times.
            restore_ordering(term_scorers, i);
            return false;
        }
    }
    true
}
// Attempts to advance all term_scorers between `&term_scorers[0..before_len]` to the pivot.
// If this works, return true.
// If this fails (ie: one of the term_scorer does not contain `pivot_doc` and seek goes past the
// pivot), reorder the term_scorers to ensure the list is still sorted and returns `false`.
// If a term_scorer reach TERMINATED in the process return false remove the term_scorer and return.
Attempts to advance all term_scorers between `&term_scorers[0..before_len]` to the pivot.
If this works, return true.
If this fails , reorder the term_scorers to ensure the list is still sorted and returns `false`.
If a term_scorer reach TERMINATED in the process return false remove the term_scorer and return.
Attempts to advance all term_scorers between ` &term_scorers [ 0 .. before_len ] ` to the pivot . If this works return true . If this fails reorder the term_scorers to ensure the list is still sorted and returns ` false ` . If a term_scorer reach TERMINATED in the process return false remove the term_scorer and return .
fn align_scorers(
    term_scorers: &mut Vec<TermScorerWithMaxScore>,
    pivot_doc: DocId,
    before_pivot_len: usize,
) -> bool {
    debug_assert_ne!(pivot_doc, TERMINATED);
    for i in (0..before_pivot_len).rev() {
        let new_doc = term_scorers[i].seek(pivot_doc);
        if new_doc != pivot_doc {
            if new_doc == TERMINATED {
                term_scorers.swap_remove(i);
            }
            // We went past the pivot.
            // We just go through the outer loop mechanic (Note that pivot is
            // still a possible candidate).
            //
            // Termination is still guaranteed since we can only consider the same
            // pivot at most term_scorers.len() - 1 times.
            restore_ordering(term_scorers, i);
            return false;
        }
    }
    true
}
fn align_scorers ( term_scorers : & mut Vec < TermScorerWithMaxScore > , pivot_doc : DocId , before_pivot_len : usize , ) -> bool { debug_assert_ne ! ( pivot_doc TERMINATED ) ; for i in ( 0 .. before_pivot_len ) . rev ( ) { let new_doc = term_scorers [ i ] . seek ( pivot_doc ) ; if new_doc != pivot_doc { if new_doc == TERMINATED { term_scorers . swap_remove ( i ) ; } // We went past the pivot. // We just go through the outer loop mechanic (Note that pivot is // still a possible candidate). // // Termination is still guaranteed since we can only consider the same // pivot at most term_scorers.len() - 1 times. restore_ordering ( term_scorers , i ) ; return false ; } } true }
Attempts to advance all term_scorers between `&term_scorers[0..before_len]` to the pivot.
Attempts to advance all term_scorers between ` &term_scorers [ 0 .. before_len ] ` to the pivot .
term_scorers
&mut Vec<TermScorerWithMaxScore>
pivot_doc
DocId
before_pivot_len
usize
term_scorers
&mut Vec<TermScorerWithMaxScore>
pivot_doc
DocId
before_pivot_len
usize