Skip to content

Commit d4fb66b

Browse files
committed
Always use the general case char count
1 parent a74509c commit d4fb66b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/str/count.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const UNROLL_INNER: usize = 4;
2424

2525
#[inline]
2626
pub(super) fn count_chars(s: &str) -> usize {
27-
if s.len() < USIZE_SIZE * UNROLL_INNER {
27+
if cfg!(feature = "optimize_for_size") || s.len() < USIZE_SIZE * UNROLL_INNER {
2828
// Avoid entering the optimized implementation for strings where the
2929
// difference is not likely to matter, or where it might even be slower.
3030
// That said, a ton of thought was not spent on the particular threshold

0 commit comments

Comments
 (0)