diff Modules/socketmodule.c @ 17806:3380279612a3 legacy-trunk

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.
author Fred Drake <fdrake@acm.org>
date Fri, 11 May 2001 20:12:26 +0000
parents 0ebfe9a1eb43
children c4db09b87424
line wrap: on
line diff
--- a/Modules/socketmodule.c	Fri May 11 19:52:57 2001 +0000
+++ b/Modules/socketmodule.c	Fri May 11 20:12:26 2001 +0000
@@ -962,8 +962,8 @@
 	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 @@
 	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();