diff options
author | Damien George <damien.p.george@gmail.com> | 2015-01-20 14:11:27 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-01-20 14:11:27 +0000 |
commit | 50149a573063dc4a1a6541686e61c310d5fc8353 (patch) | |
tree | ba09b7f32e24ee050d4888c7d1e588882d142770 /py/objfilter.c | |
parent | ff8dd3f486afb0d6ff1427d8a6a8a8ed73baa660 (diff) |
py: Use mp_arg_check_num in some _make_new functions.
Reduces stmhal code size by about 250 bytes.
Diffstat (limited to 'py/objfilter.c')
-rw-r--r-- | py/objfilter.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/py/objfilter.c b/py/objfilter.c index c9ded8d7f..a97c9f554 100644 --- a/py/objfilter.c +++ b/py/objfilter.c @@ -24,7 +24,6 @@ * THE SOFTWARE. */ -#include "py/nlr.h" #include "py/runtime.h" typedef struct _mp_obj_filter_t { @@ -34,10 +33,7 @@ typedef struct _mp_obj_filter_t { } mp_obj_filter_t; STATIC mp_obj_t filter_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { - if (n_args != 2 || n_kw != 0) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "filter expected 2 arguments")); - } - assert(n_args == 2); + mp_arg_check_num(n_args, n_kw, 2, 2, false); mp_obj_filter_t *o = m_new_obj(mp_obj_filter_t); o->base.type = type_in; o->fun = args[0]; |