diff options
author | Damien George <damien@micropython.org> | 2022-04-20 17:20:07 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2022-04-22 16:37:02 +1000 |
commit | caaff940a265bd30cca5a271b49e7addaf05ef53 (patch) | |
tree | 7413f84e38feee120173b6ea9d65ed3f3aae79f4 /extmod/uasyncio/funcs.py | |
parent | 28e7e15c0ad03f406cc5214f22d9a90a560f65c4 (diff) | |
download | micropython-caaff940a265bd30cca5a271b49e7addaf05ef53.tar.gz micropython-caaff940a265bd30cca5a271b49e7addaf05ef53.zip |
extmod/uasyncio: Rename and merge TaskQueue push/pop methods.
These are internal names and can be safely renamed without affecting user
code. push_sorted() and push_head() are merged into a single push()
method, which is already how the C version is implemented. pop_head() is
simply renamed to pop().
The changes are:
- q.push_sorted(task, t) -> q.push(task, t)
- q.push_head(task) -> q.push(task)
- q.pop_head() -> q.pop()
The shorter names and removal of push_head() leads to a code size reduction
of between 40 and 64 bytes on bare-metal targets.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'extmod/uasyncio/funcs.py')
-rw-r--r-- | extmod/uasyncio/funcs.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/extmod/uasyncio/funcs.py b/extmod/uasyncio/funcs.py index a76ab0d321..258948f73e 100644 --- a/extmod/uasyncio/funcs.py +++ b/extmod/uasyncio/funcs.py @@ -78,7 +78,7 @@ async def gather(*aws, return_exceptions=False): # Still some sub-tasks running. return # Gather waiting is done, schedule the main gather task. - core._task_queue.push_head(gather_task) + core._task_queue.push(gather_task) ts = [core._promote_to_task(aw) for aw in aws] for i in range(len(ts)): |