Commit 8af5a167 authored by Fred Drake's avatar Fred Drake

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.
parent c5c6c512
......@@ -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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment