aboutsummaryrefslogtreecommitdiff
path: root/py/runtime.c
diff options
context:
space:
mode:
authorDavid Lechner <david@pybricks.com>2022-03-29 12:44:58 -0500
committerDamien George <damien@micropython.org>2022-03-31 17:01:03 +1100
commit9b74d71aa74d368e0679616173edb4be49e03684 (patch)
treea206e41d6fdab9f5c379f7ecb6ea5f32b850366f /py/runtime.c
parent3679a47eb064850406f473bc435c36d95017c16e (diff)
py/runtime: Drop new_alloc < 4 check.
To reach this check, n_kw has to be >= 1 and therefore args2_alloc has to be >= 2. Therefore new_alloc will always be >= 4. So this check will never be true and can be removed. Signed-off-by: David Lechner <david@pybricks.com>
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/py/runtime.c b/py/runtime.c
index 95990197d..7355817b6 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -860,9 +860,6 @@ void mp_call_prepare_args_n_kw_var(bool have_self, size_t n_args_n_kw, const mp_
// expand size of args array if needed
if (args2_len + 1 >= args2_alloc) {
uint new_alloc = args2_alloc * 2;
- if (new_alloc < 4) {
- new_alloc = 4;
- }
args2 = mp_nonlocal_realloc(args2, args2_alloc * sizeof(mp_obj_t), new_alloc * sizeof(mp_obj_t));
args2_alloc = new_alloc;
}