mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Patch #1359618: Speed-up charmap encoder.
This commit is contained in:
parent
67966bed72
commit
3f767795f6
51 changed files with 510 additions and 11516 deletions
|
|
@ -792,6 +792,15 @@ charmap_encode(PyObject *self,
|
|||
return v;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
charmap_build(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *map;
|
||||
if (!PyArg_ParseTuple(args, "U:charmap_build", &map))
|
||||
return NULL;
|
||||
return PyUnicode_BuildEncodingMap(map);
|
||||
}
|
||||
|
||||
#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
|
||||
|
||||
static PyObject *
|
||||
|
|
@ -897,6 +906,7 @@ static PyMethodDef _codecs_functions[] = {
|
|||
{"ascii_decode", ascii_decode, METH_VARARGS},
|
||||
{"charmap_encode", charmap_encode, METH_VARARGS},
|
||||
{"charmap_decode", charmap_decode, METH_VARARGS},
|
||||
{"charmap_build", charmap_build, METH_VARARGS},
|
||||
{"readbuffer_encode", readbuffer_encode, METH_VARARGS},
|
||||
{"charbuffer_encode", charbuffer_encode, METH_VARARGS},
|
||||
#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue