diff options
| author | Damien George <damien@micropython.org> | 2024-07-18 12:35:42 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2024-07-18 12:35:42 +1000 |
| commit | e00d80d9e27552760603b507c77aad6f5705174f (patch) | |
| tree | 145f739f80f7e6b689791ffcf7a17009c9028bbe | |
| parent | fce3cea2440e0242fc4cf5c1825368795f540470 (diff) | |
py: Remove 5 TODOs in emitbc, objrange and repl.
These TODOs don't need to be done:
- Calling functions with keyword arguments is less common than without
them, so adding an extra byte overhead to all calls regardless of whether
they use keywords or not would overall increase generated bytecode size.
- Restricting `range` objects to machine-sized ints has been adequate for
a long time now, so no need to change that and make it more complicated
and slower.
- Printing spaces in tab completion does not need to be optimised.
Signed-off-by: Damien George <damien@micropython.org>
| -rw-r--r-- | py/emitbc.c | 4 | ||||
| -rw-r--r-- | py/objrange.c | 2 | ||||
| -rw-r--r-- | py/repl.c | 1 |
3 files changed, 2 insertions, 5 deletions
diff --git a/py/emitbc.c b/py/emitbc.c index f6bb229ba..0fbda56fd 100644 --- a/py/emitbc.c +++ b/py/emitbc.c @@ -794,10 +794,10 @@ static void emit_bc_call_function_method_helper(emit_t *emit, int stack_adj, mp_ // each positional arg is one object, each kwarg is two objects, the key // and the value and one extra object for the star args bitmap. stack_adj -= (int)n_positional + 2 * (int)n_keyword + 1; - emit_write_bytecode_byte_uint(emit, stack_adj, bytecode_base + 1, (n_keyword << 8) | n_positional); // TODO make it 2 separate uints? + emit_write_bytecode_byte_uint(emit, stack_adj, bytecode_base + 1, (n_keyword << 8) | n_positional); } else { stack_adj -= (int)n_positional + 2 * (int)n_keyword; - emit_write_bytecode_byte_uint(emit, stack_adj, bytecode_base, (n_keyword << 8) | n_positional); // TODO make it 2 separate uints? + emit_write_bytecode_byte_uint(emit, stack_adj, bytecode_base, (n_keyword << 8) | n_positional); } } diff --git a/py/objrange.c b/py/objrange.c index 9a4ecd3fc..5ccb04fba 100644 --- a/py/objrange.c +++ b/py/objrange.c @@ -33,7 +33,6 @@ typedef struct _mp_obj_range_it_t { mp_obj_base_t base; - // TODO make these values generic objects or something mp_int_t cur; mp_int_t stop; mp_int_t step; @@ -72,7 +71,6 @@ static mp_obj_t mp_obj_new_range_iterator(mp_int_t cur, mp_int_t stop, mp_int_t typedef struct _mp_obj_range_t { mp_obj_base_t base; - // TODO make these values generic objects or something mp_int_t start; mp_int_t stop; mp_int_t step; @@ -225,7 +225,6 @@ static void print_completions(const mp_print_t *print, gap += WORD_SLOT_LEN; } if (line_len + gap + d_len <= MAX_LINE_LEN) { - // TODO optimise printing of gap? for (int j = 0; j < gap; ++j) { mp_print_str(print, " "); } |
