Mercurial > hg
comparison mercurial/cext/charencode.h @ 33926:f4433f2713d0
encoding: add function to test if a str consists of ASCII characters
Most strings are ASCII. Let's optimize for it.
Using uint64_t is slightly faster than uint32_t on 64bit system, but there
isn't huge difference.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 23 Apr 2017 12:59:42 +0900 |
parents | 2c37f9dabc32 |
children | 81199632fa42 |
comparison
equal
deleted
inserted
replaced
33925:2c37f9dabc32 | 33926:f4433f2713d0 |
---|---|
17 NORMCASE_UPPER = 1, | 17 NORMCASE_UPPER = 1, |
18 NORMCASE_OTHER = 0 | 18 NORMCASE_OTHER = 0 |
19 }; | 19 }; |
20 | 20 |
21 PyObject *unhexlify(const char *str, Py_ssize_t len); | 21 PyObject *unhexlify(const char *str, Py_ssize_t len); |
22 PyObject *isasciistr(PyObject *self, PyObject *args); | |
22 PyObject *asciilower(PyObject *self, PyObject *args); | 23 PyObject *asciilower(PyObject *self, PyObject *args); |
23 PyObject *asciiupper(PyObject *self, PyObject *args); | 24 PyObject *asciiupper(PyObject *self, PyObject *args); |
24 PyObject *make_file_foldmap(PyObject *self, PyObject *args); | 25 PyObject *make_file_foldmap(PyObject *self, PyObject *args); |
25 PyObject *jsonescapeu8fast(PyObject *self, PyObject *args); | 26 PyObject *jsonescapeu8fast(PyObject *self, PyObject *args); |
26 | 27 |