mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Simplify and optimize formatlong()
* Remove _PyBytes_FormatLong(): inline it into formatlong() * the input type is always a long, so remove the code for bool * don't duplicate the string if the length does not change * Use PyUnicode_DATA() instead of _PyUnicode_AsString()
This commit is contained in:
parent
19b409a341
commit
d0880d57b0
3 changed files with 128 additions and 152 deletions
|
@ -62,8 +62,6 @@ PyAPI_FUNC(void) PyBytes_Concat(PyObject **, PyObject *);
|
|||
PyAPI_FUNC(void) PyBytes_ConcatAndDel(PyObject **, PyObject *);
|
||||
#ifndef Py_LIMITED_API
|
||||
PyAPI_FUNC(int) _PyBytes_Resize(PyObject **, Py_ssize_t);
|
||||
PyAPI_FUNC(PyObject *) _PyBytes_FormatLong(PyObject*, int, int,
|
||||
int, char**, int*);
|
||||
#endif
|
||||
PyAPI_FUNC(PyObject *) PyBytes_DecodeEscape(const char *, Py_ssize_t,
|
||||
const char *, Py_ssize_t,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue