cpython: e5bd48b43a58 (original) (raw)
Mercurial > cpython
changeset 72903:e5bd48b43a58
Optimize findchar() for PyUnicode_1BYTE_KIND: use memchr and memrchr
Victor Stinner victor.stinner@haypocalc.com | |
---|---|
date | Thu, 13 Oct 2011 00🔞12 +0200 |
parents | 9c7d3207fc15 |
children | f60e8228aeb2 |
files | Objects/unicodeobject.c |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-)[+] [-] Objects/unicodeobject.c 8 |
line wrap: on
line diff
--- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -530,6 +530,14 @@ Py_LOCAL_INLINE(char *) findchar(void s { / like wcschr, but doesn't stop at NULL characters */ Py_ssize_t i;
else[](#l1.11)
return memrchr(s, ch, size);[](#l1.12)