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.
This commit is contained in:
Fred Drake 2001-05-11 20:12:26 +00:00
parent 7e473800c3
commit 564a6cc8ca
1 changed files with 3 additions and 3 deletions

View 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();