[Python-checkins] cpython (2.7): make deque_clear void, since it's infallible

benjamin.peterson python-checkins at python.org
Sun Jan 13 03:23:12 CET 2013


http://hg.python.org/cpython/rev/ad585b439d97
changeset:   81472:ad585b439d97
branch:      2.7
parent:      81458:e651d96e6b07
user:        Benjamin Peterson <benjamin at python.org>
date:        Sat Jan 12 21:22:18 2013 -0500
summary:
  make deque_clear void, since it's infallible

files:
  Modules/_collectionsmodule.c |  8 ++------
  1 files changed, 2 insertions(+), 6 deletions(-)


diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -632,7 +632,7 @@
 PyDoc_STRVAR(remove_doc,
 "D.remove(value) -- remove first occurrence of value.");
 
-static int
+static void
 deque_clear(dequeobject *deque)
 {
     PyObject *item;
@@ -645,7 +645,6 @@
     assert(deque->leftblock == deque->rightblock &&
            deque->leftindex - 1 == deque->rightindex &&
            deque->len == 0);
-    return 0;
 }
 
 static PyObject *
@@ -748,10 +747,7 @@
 static PyObject *
 deque_clearmethod(dequeobject *deque)
 {
-    int rv;
-
-    rv = deque_clear(deque);
-    assert (rv != -1);
+    deque_clear(deque);
     Py_RETURN_NONE;
 }
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list