summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-05-11 20:12:26 (GMT)
committerFred Drake <fdrake@acm.org>2001-05-11 20:12:26 (GMT)
commit564a6cc8cae4cd9461c01ac4c7a14915744bcc1e (patch)
treedb45214d7eea0a4af948551a776a20929f7bf04c
parent7e473800c31e650ad573e5af21a6ed63e155c2f6 (diff)
downloadcpython-564a6cc8cae4cd9461c01ac4c7a14915744bcc1e.zip
cpython-564a6cc8cae4cd9461c01ac4c7a14915744bcc1e.tar.gz
cpython-564a6cc8cae4cd9461c01ac4c7a14915744bcc1e.tar.bz2
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.
-rw-r--r--Modules/socketmodule.c6
1 files 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();