Works without indexes

This commit is contained in:
Andras Schmelczer 2025-06-22 12:02:18 +01:00
parent 917d47fbaa
commit f95bd43240
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
6 changed files with 203 additions and 190 deletions

View file

@ -9,20 +9,20 @@ use crate::Token;
/// old: [0, 1, 9, 0, 2, 5]
/// new: [9, 0, 2, 5, 1]
/// ```
/// > results in an length of 4
/// > results in a length of 4
///
///
/// ```not_rust
/// old: [0, 1, 9, 0, 2, 5]
/// new: [0, 2]
/// ```
/// > results in an length of 2
/// > results in a length of 2
///
/// ```not_rust
/// old: [0, 1, 9, 0, 2, 5]
/// new: [0, 4]
/// ```
/// > results in an length of 1
/// > results in a length of 1
pub fn find_longest_prefix_contained_within<T>(old: &[Token<T>], new: &[Token<T>]) -> usize
where
T: PartialEq + Clone + std::fmt::Debug,