summaryrefslogtreecommitdiff
path: root/Cython/Utility/ModuleSetupCode.c
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2016-03-21 18:29:40 +0100
committerStefan Behnel <stefan_ml@behnel.de>2016-03-21 18:29:40 +0100
commite4c7e9f27877ac36c44e88cf62b70ffa2cbfb2da (patch)
tree161d2f96e009123124ed912268af424d87606d4a /Cython/Utility/ModuleSetupCode.c
parentccd84b1056af56308d8fc28e1e8d283aecb8e3d1 (diff)
downloadcython-e4c7e9f27877ac36c44e88cf62b70ffa2cbfb2da.tar.gz
avoid formatting call overhead for simple Unicode value case
Diffstat (limited to 'Cython/Utility/ModuleSetupCode.c')
-rw-r--r--Cython/Utility/ModuleSetupCode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c
index a5576cef2..28728384c 100644
--- a/Cython/Utility/ModuleSetupCode.c
+++ b/Cython/Utility/ModuleSetupCode.c
@@ -123,6 +123,7 @@
#define PyObject_Realloc(p) PyMem_Realloc(p)
#endif
+#define __Pyx_PyObject_FormatSimple(s, f) (likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) : PyObject_Format(s, f))
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))