summaryrefslogtreecommitdiffstatshomepage
path: root/py/objarray.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-10-17 12:17:37 +1100
committerDamien George <damien.p.george@gmail.com>2016-10-17 12:17:37 +1100
commit7d0d7215d2575a2d36d34c9a13b58cade0610a28 (patch)
tree6690dc711d4489811dfef4f01a26ae12ccf36dd0 /py/objarray.c
parent6caca3259f4ec8f298b1d35f15e4492efbcff6b1 (diff)
downloadmicropython-7d0d7215d2575a2d36d34c9a13b58cade0610a28.tar.gz
micropython-7d0d7215d2575a2d36d34c9a13b58cade0610a28.zip
py: Use mp_raise_msg helper function where appropriate.
Saves the following number of bytes of code space: 176 for bare-arm, 352 for minimal, 272 for unix x86-64, 140 for stmhal, 120 for esp8266.
Diffstat (limited to 'py/objarray.c')
-rw-r--r--py/objarray.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/objarray.c b/py/objarray.c
index 2cd0fef6b6..8e1d32f0f4 100644
--- a/py/objarray.c
+++ b/py/objarray.c
@@ -95,7 +95,7 @@ STATIC void array_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t
STATIC mp_obj_array_t *array_new(char typecode, mp_uint_t n) {
int typecode_size = mp_binary_get_size('@', typecode, NULL);
if (typecode_size == 0) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "bad typecode"));
+ mp_raise_msg(&mp_type_ValueError, "bad typecode");
}
mp_obj_array_t *o = m_new_obj(mp_obj_array_t);
#if MICROPY_PY_BUILTINS_BYTEARRAY && MICROPY_PY_ARRAY
@@ -395,7 +395,7 @@ STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value
mp_obj_array_t *src_slice = MP_OBJ_TO_PTR(value);
if (item_sz != mp_binary_get_size('@', src_slice->typecode & TYPECODE_MASK, NULL)) {
compat_error:
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "lhs and rhs should be compatible"));
+ mp_raise_msg(&mp_type_ValueError, "lhs and rhs should be compatible");
}
src_len = src_slice->len;
src_items = src_slice->items;