@@ -101,14 +101,14 @@ Sequencer<SequenceKey, Hash, KeyEqual, Allocator>::addPendingTask(
101101
102102template <class SequenceKey , class Hash , class KeyEqual , class Allocator >
103103std::shared_ptr<SequencerTask<SequenceKey>>
104- Sequencer<SequenceKey, Hash, KeyEqual, Allocator>::removePending (
104+ Sequencer<SequenceKey, Hash, KeyEqual, Allocator>::removeCompleted (
105105 SequencerKeyData<SequenceKey>& entry,
106106 const std::shared_ptr<SequencerTask<SequenceKey>>& task)
107107{
108108 // Regular tasks tasks:
109109 // * entry._tasks.empty() means that there's a bug somewhere: when we intend to delete a pending task,
110110 // the task queue must not be empty
111- // * entry._tasks.front() = = task means that there's a bug somewhere:
111+ // * entry._tasks.front() ! = task means that there's a bug somewhere:
112112 // only completed tasks are removed from the queue, and such tasks must sit at the head of the queue
113113 // Universal tasks: because we do not track the queues where universal tasks are enqueued,
114114 // entry._tasks.empty() or entry._tasks.front() != task just means that the task was never enqueued
@@ -135,7 +135,7 @@ Sequencer<SequenceKey, Hash, KeyEqual, Allocator>::removePending(
135135
136136template <class SequenceKey , class Hash , class KeyEqual , class Allocator >
137137void
138- Sequencer<SequenceKey, Hash, KeyEqual, Allocator>::removePending (
138+ Sequencer<SequenceKey, Hash, KeyEqual, Allocator>::removeCompletedAndScheduleNext (
139139 VoidContextPtr ctx,
140140 const std::shared_ptr<SequencerTask<SequenceKey>>& task)
141141{
@@ -145,14 +145,14 @@ Sequencer<SequenceKey, Hash, KeyEqual, Allocator>::removePending(
145145 // remove the task from all key queues
146146 for (auto & item : _pendingTaskQueueMap)
147147 {
148- if (std::shared_ptr<SequencerTask<SequenceKey>> nextTask = removePending (item.second , task))
148+ if (auto nextTask = removeCompleted (item.second , task))
149149 {
150150 scheduleTask (nextTask);
151151 }
152152 }
153153
154154 // remove the task from the universal queue
155- if (std::shared_ptr<SequencerTask<SequenceKey>> nextTask = removePending (_universalTaskQueue, task))
155+ if (auto nextTask = removeCompleted (_universalTaskQueue, task))
156156 {
157157 scheduleTask (nextTask);
158158 }
@@ -162,7 +162,7 @@ Sequencer<SequenceKey, Hash, KeyEqual, Allocator>::removePending(
162162 // remove the task from its key queues only
163163 for (SequencerKeyData<SequenceKey>* data : task->_keyData )
164164 {
165- if (std::shared_ptr<SequencerTask<SequenceKey>> nextTask = removePending (*data, task))
165+ if (auto nextTask = removeCompleted (*data, task))
166166 {
167167 scheduleTask (nextTask);
168168 }
@@ -200,7 +200,7 @@ Sequencer<SequenceKey, Hash, KeyEqual, Allocator>::executePending(
200200 }
201201
202202 // remove the task from the pending queues + schedule next tasks
203- sequencer->removePending (ctx, task);
203+ sequencer->removeCompletedAndScheduleNext (ctx, task);
204204 return rc;
205205}
206206
0 commit comments