From 564a6cc8cae4cd9461c01ac4c7a14915744bcc1e Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Fri, 11 May 2001 20:12:26 +0000 Subject: Fix a minor style consistency issue. When getting a string buffer for a string we just created, use PyString_AS_STRING() instead of PyString_AsString() to avoid the call overhead and extra type check. --- Modules/socketmodule.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 7e14743..062f88d 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -962,8 +962,8 @@ PySocketSock_getsockopt(PySocketSockObject *s, PyObject *args) socklen_t buflen = 0; #ifdef __BEOS__ -/* We have incomplete socket support. */ - PyErr_SetString( PySocket_Error, "getsockopt not supported" ); + /* We have incomplete socket support. */ + PyErr_SetString(PySocket_Error, "getsockopt not supported"); return NULL; #else @@ -989,7 +989,7 @@ PySocketSock_getsockopt(PySocketSockObject *s, PyObject *args) if (buf == NULL) return NULL; res = getsockopt(s->sock_fd, level, optname, - (void *)PyString_AsString(buf), &buflen); + (void *)PyString_AS_STRING(buf), &buflen); if (res < 0) { Py_DECREF(buf); return PySocket_Err(); -- cgit v0.12