kopia lustrzana https://github.com/micropython/micropython-lib
uasyncio.core: Optimize case of resuming coro with no args.
Don't create a new tuple with empty arguments for coro.send(), just use next(coro).pull/81/head
rodzic
37f8273715
commit
0e0fffc138
|
@ -64,10 +64,11 @@ class EventLoop:
|
||||||
else:
|
else:
|
||||||
delay = 0
|
delay = 0
|
||||||
try:
|
try:
|
||||||
if args == ():
|
|
||||||
args = (None,)
|
|
||||||
if __debug__:
|
if __debug__:
|
||||||
log.debug("Coroutine %s send args: %s", cb, args)
|
log.debug("Coroutine %s send args: %s", cb, args)
|
||||||
|
if args == ():
|
||||||
|
ret = next(cb)
|
||||||
|
else:
|
||||||
ret = cb.send(*args)
|
ret = cb.send(*args)
|
||||||
if __debug__:
|
if __debug__:
|
||||||
log.debug("Coroutine %s yield result: %s", cb, ret)
|
log.debug("Coroutine %s yield result: %s", cb, ret)
|
||||||
|
|
Ładowanie…
Reference in New Issue