This commit is contained in:
2025-04-20 07:28:59 +02:00
parent eccea1ad04
commit 0051754c65
11 changed files with 251 additions and 93 deletions

View File

@@ -114,21 +114,4 @@ impl TSTNode {
}
}
/// Gets the common prefix of two strings.
pub fn get_common_prefix(a: &str, b: &str) -> String {
let mut result = String::new();
let a_chars: Vec<char> = a.chars().collect();
let b_chars: Vec<char> = b.chars().collect();
let min_len = a_chars.len().min(b_chars.len());
for i in 0..min_len {
if a_chars[i] == b_chars[i] {
result.push(a_chars[i]);
} else {
break;
}
}
result
}
// Function removed as it was unused