...
This commit is contained in:
@@ -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
|
Reference in New Issue
Block a user