Add note about performance of tidy problematic consts

This commit is contained in:
Nilstrieb 2024-07-07 14:23:36 +02:00
parent 76ba11994e
commit 1cfc89ad69

View File

@ -110,6 +110,7 @@ fn generate_problems<'a>(
173390526, 721077,
];
// Returns all permutations of problematic consts, over 2000 elements.
fn generate_problematic_strings(
consts: &[u32],
letter_digit: &FxHashMap<char, char>,
@ -319,6 +320,8 @@ fn skip(path: &Path, is_dir: bool) -> bool {
ROOT_PROBLEMATIC_CONSTS,
&[('A', '4'), ('B', '8'), ('E', '3')].iter().cloned().collect(),
);
// This creates a RegexSet as regex contains performance optimizations to be able to deal with these over
// 2000 needles efficiently. This runs over the entire source code, so performance matters.
let problematic_regex = RegexSet::new(problematic_consts_strings.as_slice()).unwrap();
walk(path, skip, &mut |entry, contents| {