MCPcopy Create free account
hub / github.com/microsoft/vscode-cpptools / next

Function next

Extension/src/Utility/Async/iterators.ts:46–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44 let index = 0;
45 return {
46 async next() {
47 if (index < cache.length) {
48 return { value: cache[index++], done: false };
49 }
50 if (done) {
51 return { value: undefined, done: true };
52 }
53 index++;
54 if (!is.promise(nextElement)) {
55 nextElement = iterable[Symbol.asyncIterator]().next().then(element => {
56 if (!(done = element.done)) {
57 cache.push(element.value);
58 }
59 nextElement = undefined;
60 return element;
61 });
62 }
63 return nextElement;
64 }
65 };
66 }
67 };

Callers

nothing calls this directly

Calls 4

promiseMethod · 0.80
pushMethod · 0.80
thenMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected