mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-97982: Remove asciilib_count() (#98164)
asciilib_count() is the same than ucs1lib_count(): the code is not specialized for ASCII strings, so it's not worth it to have a separated function. Remove asciilib_count() function.
This commit is contained in:
parent
7ec2e279fe
commit
df3a6d9beb
2 changed files with 11 additions and 15 deletions
|
@ -4,6 +4,11 @@
|
|||
#error must include "stringlib/fastsearch.h" before including this module
|
||||
#endif
|
||||
|
||||
// gh-97982: Implementing asciilib_count() is not worth it, FASTSEARCH() does
|
||||
// not specialize the code for ASCII strings. Use ucs1lib_count() for ASCII and
|
||||
// UCS1 strings: it's the same than asciilib_count().
|
||||
#if !STRINGLIB_IS_UNICODE || STRINGLIB_MAX_CHAR > 0x7Fu
|
||||
|
||||
Py_LOCAL_INLINE(Py_ssize_t)
|
||||
STRINGLIB(count)(const STRINGLIB_CHAR* str, Py_ssize_t str_len,
|
||||
const STRINGLIB_CHAR* sub, Py_ssize_t sub_len,
|
||||
|
@ -24,4 +29,4 @@ STRINGLIB(count)(const STRINGLIB_CHAR* str, Py_ssize_t str_len,
|
|||
return count;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue