mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Modify _PyBytes_DecodeEscapeRecode() to use _PyBytesAPI
* Don't overallocate by 400% when recode is needed: only overallocate on demand using _PyBytesWriter. * Use _PyLong_DigitValue to convert hexadecimal digit to int * Create _PyBytes_DecodeEscapeRecode() subfunction
This commit is contained in:
parent
1285e5c805
commit
2ec8063cc9
2 changed files with 75 additions and 59 deletions
|
|
@ -65,7 +65,8 @@ PyAPI_FUNC(PyObject *) PyLong_GetInfo(void);
|
|||
# error "void* different in size from int, long and long long"
|
||||
#endif /* SIZEOF_VOID_P */
|
||||
|
||||
/* Used by Python/mystrtoul.c and _PyBytes_FromHex(). */
|
||||
/* Used by Python/mystrtoul.c, _PyBytes_FromHex(),
|
||||
_PyBytes_DecodeEscapeRecode(), etc. */
|
||||
#ifndef Py_LIMITED_API
|
||||
PyAPI_DATA(unsigned char) _PyLong_DigitValue[256];
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue