From fe915ac461ea4e2f13e8a204809e1b4dd095ddd2 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Fri, 28 Dec 2018 03:01:58 +0100 Subject: [PATCH] Bytes_Format: use a couple of macros instead of functions The type was already checked upstream in the func body. --- psycopg/bytes_format.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/psycopg/bytes_format.c b/psycopg/bytes_format.c index 12899142..c11b1b7d 100644 --- a/psycopg/bytes_format.c +++ b/psycopg/bytes_format.c @@ -123,7 +123,7 @@ Bytes_Format(PyObject *format, PyObject *args) result = Bytes_FromStringAndSize((char *)NULL, reslen); if (result == NULL) return NULL; - res = Bytes_AsString(result); + res = Bytes_AS_STRING(result); if (PyTuple_Check(args)) { arglen = PyTuple_GET_SIZE(args); argidx = 0; @@ -238,8 +238,7 @@ Bytes_Format(PyObject *format, PyObject *args) "unsupported format character '%c' (0x%x) " "at index " FORMAT_CODE_PY_SSIZE_T, c, c, - (Py_ssize_t)(fmt - 1 - - Bytes_AsString(format))); + (Py_ssize_t)(fmt - 1 - Bytes_AS_STRING(format))); goto error; } if (width < len)