From ea8d06c39d9c94036e490b300d46f367c9eb78d9 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 17 Apr 2014 23:19:36 +0100 Subject: py: Add MP_OBJ_STOP_ITERATION and make good use of it. Also make consistent use of MP_OBJ_NOT_SUPPORTED and MP_OBJ_NULL. This helps a lot in debugging and understanding of function API. --- py/objzip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'py/objzip.c') diff --git a/py/objzip.c b/py/objzip.c index 9ed8b56f6b..4c7070b7c7 100644 --- a/py/objzip.c +++ b/py/objzip.c @@ -30,16 +30,16 @@ STATIC mp_obj_t zip_iternext(mp_obj_t self_in) { mp_obj_zip_t *self = self_in; mp_obj_t *items; if (self->n_iters == 0) { - return MP_OBJ_NULL; + return MP_OBJ_STOP_ITERATION; } mp_obj_t o = mp_obj_new_tuple(self->n_iters, NULL); mp_obj_tuple_get(o, NULL, &items); for (int i = 0; i < self->n_iters; i++) { mp_obj_t next = mp_iternext(self->iters[i]); - if (next == MP_OBJ_NULL) { + if (next == MP_OBJ_STOP_ITERATION) { mp_obj_tuple_del(o); - return MP_OBJ_NULL; + return MP_OBJ_STOP_ITERATION; } items[i] = next; } -- cgit v1.2.3