pub(crate) fn find_conflict(&self, ents: &[Entry]) -> u64 {
        for ent in ents {
            if !self.match_term(ent.get_Index(), ent.get_Term()) {
                // info!("not match at index {}", ent.get_Index());
                if ent.get_Index() <= self.last_index() {
                    let exist_term = self.term(ent.get_Index()).map_or(0, |t| t);
                    info!(
                        "found conflict at index {} [existing term: {}, conflicting term: {}]",
                        ent.get_Index(),
                        exist_term,
                        ent.get_Term()
                    );
                }
                return ent.get_Index();
            }
        }
        0
    }
// find_conflict finds the index of the conflict.
// It returns the first pair of conflicting entries between the existing
// entries and the given entries, if there are any.
// If there is no conflicting entries, and the existing entries contains
// all the given entries, zero will be returned.
// If there is no conflicting entries, but the given entries contains new
// entries, the index of the first new entry will be returned.
// An entry is considered to be conflicting if it has the same index but
// a different term.
// The first entry MUST be have an index equal to the argument `from`.
// The index of the given entries MUST be continuously increasing.
find_conflict finds the index of the conflict.
It returns the first pair of conflicting entries between the existing
entries and the given entries, if there are any.
If there is no conflicting entries, and the existing entries contains
all the given entries, zero will be returned.
If there is no conflicting entries, but the given entries contains new
entries, the index of the first new entry will be returned.
An entry is considered to be conflicting if it has the same index but
a different term.
The first entry MUST be have an index equal to the argument `from`.
The index of the given entries MUST be continuously increasing.
find_conflict finds the index of the conflict . It returns the first pair of conflicting entries between the existing entries and the given entries if there are any . If there is no conflicting entries and the existing entries contains all the given entries zero will be returned . If there is no conflicting entries but the given entries contains new entries the index of the first new entry will be returned . An entry is considered to be conflicting if it has the same index but a different term . The first entry MUST be have an index equal to the argument ` from ` . The index of the given entries MUST be continuously increasing .
pub(crate) fn find_conflict(&self, ents: &[Entry]) -> u64 {
        for ent in ents {
            if !self.match_term(ent.get_Index(), ent.get_Term()) {
                // info!("not match at index {}", ent.get_Index());
                if ent.get_Index() <= self.last_index() {
                    let exist_term = self.term(ent.get_Index()).map_or(0, |t| t);
                    info!(
                        "found conflict at index {} [existing term: {}, conflicting term: {}]",
                        ent.get_Index(),
                        exist_term,
                        ent.get_Term()
                    );
                }
                return ent.get_Index();
            }
        }
        0
    }
pub ( crate ) fn find_conflict ( & self , ents : & [ Entry ] ) -> u64 { for ent in ents { if ! self . match_term ( ent . get_Index ( ) , ent . get_Term ( ) ) { // info!("not match at index {}", ent.get_Index()); if ent . get_Index ( ) <= self . last_index ( ) { let exist_term = self . term ( ent . get_Index ( ) ) . map_or ( 0 , | t | t ) ; info ! ( " " ent get_Index ( ) exist_term ent get_Term ( ) ) ; } return ent . get_Index ( ) ; } } 0 }
find_conflict finds the index of the conflict.
find_conflict finds the index of the conflict .
&self
ents
&[Entry]