(
target: Array<number | VoidFunction>,
invokeAt: number,
callback: VoidFunction,
)
| 84 | } |
| 85 | |
| 86 | private addToQueue( |
| 87 | target: Array<number | VoidFunction>, |
| 88 | invokeAt: number, |
| 89 | callback: VoidFunction, |
| 90 | ) { |
| 91 | let insertAtIndex = target.length; |
| 92 | for (let i = 0; i < target.length; i += 2) { |
| 93 | const invokeQueuedCallbackAt = target[i] as number; |
| 94 | if (invokeQueuedCallbackAt > invokeAt) { |
| 95 | // We've reached a first timer that is scheduled |
| 96 | // for a later time than what we are trying to insert. |
| 97 | // This is the location at which we need to insert, |
| 98 | // no need to iterate further. |
| 99 | insertAtIndex = i; |
| 100 | break; |
| 101 | } |
| 102 | } |
| 103 | arrayInsert2(target, insertAtIndex, invokeAt, callback); |
| 104 | } |
| 105 | |
| 106 | private removeFromQueue(target: Array<number | VoidFunction>, callback: VoidFunction) { |
| 107 | let index = -1; |
no test coverage detected