Skip to content

Commit 1cfc89a

Browse files
committed
Add note about performance of tidy problematic consts
1 parent 76ba119 commit 1cfc89a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/tools/tidy/src/style.rs

+3
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ const ROOT_PROBLEMATIC_CONSTS: &[u32] = &[
110110
173390526, 721077,
111111
];
112112

113+
// Returns all permutations of problematic consts, over 2000 elements.
113114
fn generate_problematic_strings(
114115
consts: &[u32],
115116
letter_digit: &FxHashMap<char, char>,
@@ -319,6 +320,8 @@ pub fn check(path: &Path, bad: &mut bool) {
319320
ROOT_PROBLEMATIC_CONSTS,
320321
&[('A', '4'), ('B', '8'), ('E', '3')].iter().cloned().collect(),
321322
);
323+
// This creates a RegexSet as regex contains performance optimizations to be able to deal with these over
324+
// 2000 needles efficiently. This runs over the entire source code, so performance matters.
322325
let problematic_regex = RegexSet::new(problematic_consts_strings.as_slice()).unwrap();
323326

324327
walk(path, skip, &mut |entry, contents| {

0 commit comments

Comments
 (0)