levenshtein_with_buffer

Function levenshtein_with_buffer 

Source
pub fn levenshtein_with_buffer(
    a: &str,
    b: &str,
    cache: &mut Vec<usize>,
) -> usize
Expand description

Calculates the Levenshtein distance using a reusable cache buffer. This avoids allocating a new Vec for each call, improving performance when computing many distances.

The cache buffer will be resized as needed and reused across calls.