MCPcopy Index your code
hub / github.com/ampproject/amphtml / removeAtIndex

Method removeAtIndex

src/service/task-queue.js:137–145  ·  view source on GitHub ↗

* Removes the task and returns "true" if dequeueing is successful. Otherwise * returns "false", e.g. when this task is not currently enqueued. * @param {!TaskDef} task * @param {number} index of the task to remove. * @return {boolean}

(task, index)

Source from the content-addressed store, hash-verified

135 * @return {boolean}
136 */
137 removeAtIndex(task, index) {
138 const existing = this.taskIdMap_[task.id];
139 if (!existing || this.tasks_[index] != existing) {
140 return false;
141 }
142 this.tasks_.splice(index, 1);
143 delete this.taskIdMap_[task.id];
144 return true;
145 }
146
147 /**
148 * Removes tasks in queue that pass the callback test.

Callers 2

dequeueMethod · 0.95
purgeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected