We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a74509c commit d4fb66bCopy full SHA for d4fb66b
core/src/str/count.rs
@@ -24,7 +24,7 @@ const UNROLL_INNER: usize = 4;
24
25
#[inline]
26
pub(super) fn count_chars(s: &str) -> usize {
27
- if s.len() < USIZE_SIZE * UNROLL_INNER {
+ if cfg!(feature = "optimize_for_size") || s.len() < USIZE_SIZE * UNROLL_INNER {
28
// Avoid entering the optimized implementation for strings where the
29
// difference is not likely to matter, or where it might even be slower.
30
// That said, a ton of thought was not spent on the particular threshold
0 commit comments