Skip to content

Commit 98c546b

Browse files
jeplermicrodev1
andauthored
call common validation function
Co-authored-by: MicroDev <[email protected]>
1 parent 349dedc commit 98c546b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

shared-module/struct/__init__.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,7 @@ void shared_modules_struct_pack_into(mp_obj_t fmt_in, byte *p, byte *end_p, size
167167
}
168168
fmt++;
169169
}
170-
if (i != n_args) {
171-
mp_raise_ValueError_varg(translate("%q length must be %d"), MP_QSTR_args, i);
172-
}
170+
(void)mp_arg_validate_length(n_args, i, MP_QSTR_args);
173171
}
174172

175173
mp_obj_tuple_t *shared_modules_struct_unpack_from(mp_obj_t fmt_in, byte *p, byte *end_p, bool exact_size) {

0 commit comments

Comments
 (0)