diff options
author | Dong-hee Na <donghee.na@python.org> | 2021-09-11 15:04:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-11 15:04:38 (GMT) |
commit | 9abd07e5963f966c4d6df8f4e4bf390ed8191066 (patch) | |
tree | 2f743801d5f187e0a6c241b810f9ea3f8fbf6e7f /Modules | |
parent | 97ea18ecede8bfd33d5ab2dd0e7e2aada2051111 (diff) | |
download | cpython-9abd07e5963f966c4d6df8f4e4bf390ed8191066.zip cpython-9abd07e5963f966c4d6df8f4e4bf390ed8191066.tar.gz cpython-9abd07e5963f966c4d6df8f4e4bf390ed8191066.tar.bz2 |
bpo-44987: Speed up unicode normalization of ASCII strings (GH-28283)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/unicodedata.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c index b4563f3..9758572 100644 --- a/Modules/unicodedata.c +++ b/Modules/unicodedata.c @@ -807,6 +807,10 @@ is_normalized_quickcheck(PyObject *self, PyObject *input, bool nfc, bool k, return NO; } + if (PyUnicode_IS_ASCII(input)) { + return YES; + } + Py_ssize_t i, len; int kind; const void *data; |