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>
This commit is contained in:
Damien George
2022-04-20 17:20:07 +10:00
parent 28e7e15c0a
commit caaff940a2
6 changed files with 31 additions and 35 deletions

View File

@@ -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)):