@@ -181,7 +181,6 @@ cdef class Loop:
181181 self ._queued_streams = set ()
182182 self ._executing_streams = set ()
183183 self ._ready = col_deque()
184- self ._ready_len = 0
185184
186185 self .handler_async = UVAsync.new(
187186 self , < method_t> self ._on_wake, self )
@@ -440,7 +439,7 @@ cdef class Loop:
440439 self .handler_async.send()
441440
442441 cdef _on_wake(self ):
443- if ((self ._ready_len > 0 or self ._stopping) and
442+ if ((len ( self ._ready) > 0 or self ._stopping) and
444443 not self .handler_idle.running):
445444 self .handler_idle.start()
446445
@@ -481,8 +480,7 @@ cdef class Loop:
481480 if len (self ._queued_streams):
482481 self ._exec_queued_writes()
483482
484- self ._ready_len = len (self ._ready)
485- if self ._ready_len == 0 and self .handler_idle.running:
483+ if len (self ._ready) == 0 and self .handler_idle.running:
486484 self .handler_idle.stop()
487485
488486 if self ._stopping:
@@ -570,7 +568,6 @@ cdef class Loop:
570568 for cb_handle in self ._ready:
571569 cb_handle.cancel()
572570 self ._ready.clear()
573- self ._ready_len = 0
574571
575572 if self ._polls:
576573 for poll_handle in self ._polls.values():
@@ -672,7 +669,6 @@ cdef class Loop:
672669 cdef inline _append_ready_handle(self , Handle handle):
673670 self ._check_closed()
674671 self ._ready.append(handle)
675- self ._ready_len += 1
676672
677673 cdef inline _call_soon_handle(self , Handle handle):
678674 self ._append_ready_handle(handle)
0 commit comments