Mailing List Archive

CVS: python/dist/src/Modules socketmodule.c,1.142,1.143
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv30292/Modules

Modified Files:
socketmodule.c
Log Message:

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.


Index: socketmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v
retrieving revision 1.142
retrieving revision 1.143
diff -C2 -r1.142 -r1.143
*** socketmodule.c 2001/05/09 19:11:33 1.142
--- socketmodule.c 2001/05/11 20:12:26 1.143
***************
*** 963,968 ****

#ifdef __BEOS__
! /* We have incomplete socket support. */
! PyErr_SetString( PySocket_Error, "getsockopt not supported" );
return NULL;
#else
--- 963,968 ----

#ifdef __BEOS__
! /* We have incomplete socket support. */
! PyErr_SetString(PySocket_Error, "getsockopt not supported");
return NULL;
#else
***************
*** 990,994 ****
return NULL;
res = getsockopt(s->sock_fd, level, optname,
! (void *)PyString_AsString(buf), &buflen);
if (res < 0) {
Py_DECREF(buf);
--- 990,994 ----
return NULL;
res = getsockopt(s->sock_fd, level, optname,
! (void *)PyString_AS_STRING(buf), &buflen);
if (res < 0) {
Py_DECREF(buf);