Skip to content

Commit

Permalink
pybricks.tools: remove duplicate wait time clamp
Browse files Browse the repository at this point in the history
pbio_int_math_bind() already ensures that time >= 0, so we don't need
to clamp it again later.
  • Loading branch information
dlech committed Aug 24, 2024
1 parent dac5525 commit 4d3585f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pybricks/tools/pb_module_tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static mp_obj_t pb_module_tools_wait(size_t n_args, const mp_obj_t *pos_args, mp
return pb_type_awaitable_await_or_wait(
NULL, // wait functions are not associated with an object
MP_STATE_PORT(wait_awaitables),
mp_hal_ticks_ms() + (time < 0 ? 0 : time),
mp_hal_ticks_ms() + time,
pb_module_tools_wait_test_completion,
pb_type_awaitable_return_none,
pb_type_awaitable_cancel_none,
Expand Down

0 comments on commit 4d3585f

Please sign in to comment.