summaryrefslogtreecommitdiffstats
path: root/Objects/stringlib/replace.h
diff options
context:
space:
mode:
authorgoldsteinn <35538541+goldsteinn@users.noreply.github.com>2022-05-24 01:45:31 (GMT)
committerGitHub <noreply@github.com>2022-05-24 01:45:31 (GMT)
commit7108bdf27c7a460cf83c4a01dea54ae4591d8aea (patch)
tree0ebf080594979a194459f6d5f4f30cb6fafffdac /Objects/stringlib/replace.h
parentf7fabae75c7b8ecd0c5673b5d62a15db24a05953 (diff)
downloadcpython-7108bdf27c7a460cf83c4a01dea54ae4591d8aea.zip
cpython-7108bdf27c7a460cf83c4a01dea54ae4591d8aea.tar.gz
cpython-7108bdf27c7a460cf83c4a01dea54ae4591d8aea.tar.bz2
gh-93033: Use wmemchr in stringlib (GH-93034)
Generally comparable perf for the "good" case where memchr doesn't return any collisions (false matches on lower byte) but clearly faster with collisions.
Diffstat (limited to 'Objects/stringlib/replace.h')
-rw-r--r--Objects/stringlib/replace.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/stringlib/replace.h b/Objects/stringlib/replace.h
index ef318ed..123c9f8 100644
--- a/Objects/stringlib/replace.h
+++ b/Objects/stringlib/replace.h
@@ -29,9 +29,9 @@ STRINGLIB(replace_1char_inplace)(STRINGLIB_CHAR* s, STRINGLIB_CHAR* end,
if (!--attempts) {
/* if u1 was not found for attempts iterations,
use FASTSEARCH() or memchr() */
-#if STRINGLIB_SIZEOF_CHAR == 1
+#ifdef STRINGLIB_FAST_MEMCHR
s++;
- s = memchr(s, u1, end - s);
+ s = STRINGLIB_FAST_MEMCHR(s, u1, end - s);
if (s == NULL)
return;
#else