[Xcb] [PATCH xpyb 02/10] error.c: Delete explicit comparison with NULL
Tapasweni Pathak
tapaswenipathak at gmail.com
Sun Oct 12 21:48:00 PDT 2014
if (pointer == NULL) is functionally equivalent to
if (!pointer).
Using the second will make it a bit obvious that there is a
pointer involved and not an integer or something.
This patch deletes explicit comaprison with NULL in error.c file.
Signed-off-by: Tapasweni Pathak <tapaswenipathak at gmail.com>
---
src/error.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/error.c b/src/error.c
index c51530b..f669485 100644
--- a/src/error.c
+++ b/src/error.c
@@ -24,11 +24,11 @@ xpybError_set(xpybConn *conn, xcb_generic_error_t *e)
}
shim = PyBuffer_FromMemory(e, sizeof(*e));
- if (shim == NULL)
+ if (!shim)
return 1;
error = PyObject_CallFunctionObjArgs(type, shim, NULL);
- if (error != NULL)
+ if (error)
PyErr_SetObject(except, error);
Py_DECREF(shim);
return 1;
--
1.7.9.5
More information about the Xcb
mailing list