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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy