about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2024-07-07 14:23:36 +0200
committerNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2024-07-07 14:23:36 +0200
commit1cfc89ad691f807ff157ed99104aee9118fdc3fe (patch)
tree3db7e02aa7e705b65403dd155d0277b0606d85f3 /src
parent76ba11994e3b94890ec61bd75c2d2b9a428d151d (diff)
downloadrust-1cfc89ad691f807ff157ed99104aee9118fdc3fe.tar.gz
rust-1cfc89ad691f807ff157ed99104aee9118fdc3fe.zip
Add note about performance of tidy problematic consts
Diffstat (limited to 'src')
-rw-r--r--src/tools/tidy/src/style.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs
index e4d54d2a2b5..8e693c35adc 100644
--- a/src/tools/tidy/src/style.rs
+++ b/src/tools/tidy/src/style.rs
@@ -110,6 +110,7 @@ const ROOT_PROBLEMATIC_CONSTS: &[u32] = &[
     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 @@ pub fn check(path: &Path, bad: &mut 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| {