/// Check if two LMS substrings are equal.
Check if two LMS substrings are equal.
Check if two LMS substrings are equal .
fn lms_substring_eq<T: Integer + Unsigned + NumCast + Copy>(
        &self,
        text: &[T],
        pos_types: &PosTypes,
        i: usize,
        j: usize,
    ) -> bool {
        for k in 0.. {
            let lmsi = pos_types.is_lms_pos(i + k);
            let lmsj = pos_types.is_lms_pos(j + k);
            if text[i + k] != text[j + k] {
                // different symbols
                return false;
            }
            if lmsi != lmsj {
                // different length
                return false;
            }
            if k > 0 && lmsi && lmsj {
                // same symbols and same length
                return true;
            }
        }
        false
    }
fn lms_substring_eq < T : Integer + Unsigned + NumCast + Copy > ( & self , text : & [ T ] , pos_types : & PosTypes , i : usize , j : usize , ) -> bool { for k in 0 .. { let lmsi = pos_types . is_lms_pos ( i + k ) ; let lmsj = pos_types . is_lms_pos ( j + k ) ; if text [ i + k ] != text [ j + k ] { // different symbols return false ; } if lmsi != lmsj { // different length return false ; } if k > 0 && lmsi && lmsj { // same symbols and same length return true ; } } false }
Check if two LMS substrings are equal.
Check if two LMS substrings are equal .
&self
text
&[T]
pos_types
&PosTypes
i
usize
j
usize