From: Raymond Hettinger Date: Wed, 13 May 2015 08:44:36 +0000 (-0700) Subject: Minor stylistic and consistency cleanup. X-Git-Tag: v3.5.0b1~163 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5af9e13c1865d71e2517a4f72354d4938e1e28fa;p=python Minor stylistic and consistency cleanup. --- diff --git a/Objects/setobject.c b/Objects/setobject.c index 2227128e04..1805debba1 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -307,7 +307,7 @@ set_add_entry(PySetObject *so, setentry *entry) assert(so->fill <= so->mask); /* at least one empty slot */ n_used = so->used; Py_INCREF(key); - if (set_insert_key(so, key, hash) == -1) { + if (set_insert_key(so, key, hash)) { Py_DECREF(key); return -1; } @@ -923,7 +923,7 @@ set_update_internal(PySetObject *so, PyObject *other) an_entry.hash = hash; an_entry.key = key; - if (set_add_entry(so, &an_entry) == -1) + if (set_add_entry(so, &an_entry)) return -1; } return 0; @@ -934,7 +934,7 @@ set_update_internal(PySetObject *so, PyObject *other) return -1; while ((key = PyIter_Next(it)) != NULL) { - if (set_add_key(so, key) == -1) { + if (set_add_key(so, key)) { Py_DECREF(it); Py_DECREF(key); return -1; @@ -954,7 +954,7 @@ set_update(PySetObject *so, PyObject *args) for (i=0 ; iweakreflist = NULL; if (iterable != NULL) { - if (set_update_internal(so, iterable) == -1) { + if (set_update_internal(so, iterable)) { Py_DECREF(so); return NULL; } @@ -1153,7 +1153,7 @@ set_union(PySetObject *so, PyObject *args) other = PyTuple_GET_ITEM(args, i); if ((PyObject *)so == other) continue; - if (set_update_internal(result, other) == -1) { + if (set_update_internal(result, other)) { Py_DECREF(result); return NULL; } @@ -1179,7 +1179,7 @@ set_or(PySetObject *so, PyObject *other) return NULL; if ((PyObject *)so == other) return (PyObject *)result; - if (set_update_internal(result, other) == -1) { + if (set_update_internal(result, other)) { Py_DECREF(result); return NULL; } @@ -1192,7 +1192,7 @@ set_ior(PySetObject *so, PyObject *other) if (!PyAnySet_Check(other)) Py_RETURN_NOTIMPLEMENTED; - if (set_update_internal(so, other) == -1) + if (set_update_internal(so, other)) return NULL; Py_INCREF(so); return (PyObject *)so; @@ -1228,7 +1228,7 @@ set_intersection(PySetObject *so, PyObject *other) return NULL; } if (rv) { - if (set_add_entry(result, entry) == -1) { + if (set_add_entry(result, entry)) { Py_DECREF(result); return NULL; } @@ -1264,7 +1264,7 @@ set_intersection(PySetObject *so, PyObject *other) return NULL; } if (rv) { - if (set_add_entry(result, &entry) == -1) { + if (set_add_entry(result, &entry)) { Py_DECREF(it); Py_DECREF(result); Py_DECREF(key); @@ -1472,7 +1472,7 @@ set_difference_update(PySetObject *so, PyObject *args) for (i=0 ; ihash; entrycopy.key = entry->key; if (!_PyDict_Contains(other, entry->key, entry->hash)) { - if (set_add_entry((PySetObject *)result, &entrycopy) == -1) { + if (set_add_entry((PySetObject *)result, &entrycopy)) { Py_DECREF(result); return NULL; } @@ -1539,7 +1539,7 @@ set_difference(PySetObject *so, PyObject *other) return NULL; } if (!rv) { - if (set_add_entry((PySetObject *)result, entry) == -1) { + if (set_add_entry((PySetObject *)result, entry)) { Py_DECREF(result); return NULL; } @@ -1564,7 +1564,7 @@ set_difference_multi(PySetObject *so, PyObject *args) for (i=1 ; i