Use AS_STRING() following the check and avoid an extra call.
This commit is contained in:
parent
7d3dff2b39
commit
a4c8cd7b2c
@ -647,7 +647,7 @@ convertsimple(PyObject *arg, char **p_format, va_list *p_va, char *msgbuf)
|
|||||||
if (arg == Py_None)
|
if (arg == Py_None)
|
||||||
*p = 0;
|
*p = 0;
|
||||||
else if (PyString_Check(arg))
|
else if (PyString_Check(arg))
|
||||||
*p = PyString_AsString(arg);
|
*p = PyString_AS_STRING(arg);
|
||||||
#ifdef Py_USING_UNICODE
|
#ifdef Py_USING_UNICODE
|
||||||
else if (PyUnicode_Check(arg)) {
|
else if (PyUnicode_Check(arg)) {
|
||||||
uarg = UNICODE_DEFAULT_ENCODING(arg);
|
uarg = UNICODE_DEFAULT_ENCODING(arg);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user