@@ -103,7 +103,7 @@ STATIC mp_obj_t task_queue_peek(mp_obj_t self_in) {
103103}
104104STATIC MP_DEFINE_CONST_FUN_OBJ_1 (task_queue_peek_obj , task_queue_peek );
105105
106- STATIC mp_obj_t task_queue_push_sorted (size_t n_args , const mp_obj_t * args ) {
106+ STATIC mp_obj_t task_queue_push (size_t n_args , const mp_obj_t * args ) {
107107 mp_obj_task_queue_t * self = MP_OBJ_TO_PTR (args [0 ]);
108108 mp_obj_task_t * task = MP_OBJ_TO_PTR (args [1 ]);
109109 task -> data = mp_const_none ;
@@ -116,9 +116,9 @@ STATIC mp_obj_t task_queue_push_sorted(size_t n_args, const mp_obj_t *args) {
116116 self -> heap = (mp_obj_task_t * )mp_pairheap_push (task_lt , TASK_PAIRHEAP (self -> heap ), TASK_PAIRHEAP (task ));
117117 return mp_const_none ;
118118}
119- STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (task_queue_push_sorted_obj , 2 , 3 , task_queue_push_sorted );
119+ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (task_queue_push_obj , 2 , 3 , task_queue_push );
120120
121- STATIC mp_obj_t task_queue_pop_head (mp_obj_t self_in ) {
121+ STATIC mp_obj_t task_queue_pop (mp_obj_t self_in ) {
122122 mp_obj_task_queue_t * self = MP_OBJ_TO_PTR (self_in );
123123 mp_obj_task_t * head = (mp_obj_task_t * )mp_pairheap_peek (task_lt , & self -> heap -> pairheap );
124124 if (head == NULL ) {
@@ -127,7 +127,7 @@ STATIC mp_obj_t task_queue_pop_head(mp_obj_t self_in) {
127127 self -> heap = (mp_obj_task_t * )mp_pairheap_pop (task_lt , & self -> heap -> pairheap );
128128 return MP_OBJ_FROM_PTR (head );
129129}
130- STATIC MP_DEFINE_CONST_FUN_OBJ_1 (task_queue_pop_head_obj , task_queue_pop_head );
130+ STATIC MP_DEFINE_CONST_FUN_OBJ_1 (task_queue_pop_obj , task_queue_pop );
131131
132132STATIC mp_obj_t task_queue_remove (mp_obj_t self_in , mp_obj_t task_in ) {
133133 mp_obj_task_queue_t * self = MP_OBJ_TO_PTR (self_in );
@@ -139,9 +139,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(task_queue_remove_obj, task_queue_remove);
139139
140140STATIC const mp_rom_map_elem_t task_queue_locals_dict_table [] = {
141141 { MP_ROM_QSTR (MP_QSTR_peek ), MP_ROM_PTR (& task_queue_peek_obj ) },
142- { MP_ROM_QSTR (MP_QSTR_push_sorted ), MP_ROM_PTR (& task_queue_push_sorted_obj ) },
143- { MP_ROM_QSTR (MP_QSTR_push_head ), MP_ROM_PTR (& task_queue_push_sorted_obj ) },
144- { MP_ROM_QSTR (MP_QSTR_pop_head ), MP_ROM_PTR (& task_queue_pop_head_obj ) },
142+ { MP_ROM_QSTR (MP_QSTR_push ), MP_ROM_PTR (& task_queue_push_obj ) },
143+ { MP_ROM_QSTR (MP_QSTR_pop ), MP_ROM_PTR (& task_queue_pop_obj ) },
145144 { MP_ROM_QSTR (MP_QSTR_remove ), MP_ROM_PTR (& task_queue_remove_obj ) },
146145};
147146STATIC MP_DEFINE_CONST_DICT (task_queue_locals_dict , task_queue_locals_dict_table );
@@ -205,18 +204,18 @@ STATIC mp_obj_t task_cancel(mp_obj_t self_in) {
205204 // Not on the main running queue, remove the task from the queue it's on.
206205 dest [2 ] = MP_OBJ_FROM_PTR (self );
207206 mp_call_method_n_kw (1 , 0 , dest );
208- // _task_queue.push_head (self)
207+ // _task_queue.push (self)
209208 dest [0 ] = _task_queue ;
210209 dest [1 ] = MP_OBJ_FROM_PTR (self );
211- task_queue_push_sorted (2 , dest );
210+ task_queue_push (2 , dest );
212211 } else if (ticks_diff (self -> ph_key , ticks ()) > 0 ) {
213212 // On the main running queue but scheduled in the future, so bring it forward to now.
214213 // _task_queue.remove(self)
215214 task_queue_remove (_task_queue , MP_OBJ_FROM_PTR (self ));
216- // _task_queue.push_head (self)
215+ // _task_queue.push (self)
217216 dest [0 ] = _task_queue ;
218217 dest [1 ] = MP_OBJ_FROM_PTR (self );
219- task_queue_push_sorted (2 , dest );
218+ task_queue_push (2 , dest );
220219 }
221220
222221 self -> data = mp_obj_dict_get (uasyncio_context , MP_OBJ_NEW_QSTR (MP_QSTR_CancelledError ));
@@ -281,7 +280,7 @@ STATIC mp_obj_t task_iternext(mp_obj_t self_in) {
281280 // Put calling task on waiting queue.
282281 mp_obj_t cur_task = mp_obj_dict_get (uasyncio_context , MP_OBJ_NEW_QSTR (MP_QSTR_cur_task ));
283282 mp_obj_t args [2 ] = { self -> state , cur_task };
284- task_queue_push_sorted (2 , args );
283+ task_queue_push (2 , args );
285284 // Set calling task's data to this task that it waits on, to double-link it.
286285 ((mp_obj_task_t * )MP_OBJ_TO_PTR (cur_task ))-> data = self_in ;
287286 }
0 commit comments