]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix a minor style consistency issue.
authorFred Drake <fdrake@acm.org>
Fri, 11 May 2001 20:12:26 +0000 (20:12 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 11 May 2001 20:12:26 +0000 (20:12 +0000)
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

index 7e14743a893974b21c5aad749def92f93a7f0a1d..062f88d2553b2ae74aa6dfe61ce2d14482aee229 100644 (file)
@@ -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();