Skip to content

Commit 1b811b9

Browse files
committed
unix/modsocket: Use mp_const_empty_map instead of creating empty map.
1 parent 069654f commit 1b811b9

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

unix/modsocket.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,7 @@ STATIC mp_obj_t socket_makefile(size_t n_args, const mp_obj_t *args) {
316316
mp_obj_t *new_args = alloca(n_args * sizeof(mp_obj_t));
317317
memcpy(new_args + 1, args + 1, (n_args - 1) * sizeof(mp_obj_t));
318318
new_args[0] = MP_OBJ_NEW_SMALL_INT(self->fd);
319-
mp_map_t kwargs;
320-
mp_map_init(&kwargs, 0);
321-
return mp_builtin_open(n_args, new_args, &kwargs);
319+
return mp_builtin_open(n_args, new_args, (mp_map_t*)&mp_const_empty_map);
322320
}
323321
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_makefile_obj, 1, 3, socket_makefile);
324322

0 commit comments

Comments
 (0)