MCPcopy Index your code
hub / github.com/nodejs/node / #tryTrimBuffer

Method #tryTrimBuffer

lib/internal/streams/iter/share.js:356–369  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

354 }
355
356 #tryTrimBuffer() {
357 if (this.#cachedMinCursorConsumers === 0) {
358 this.#recomputeMinCursor();
359 }
360 const trimCount = this.#cachedMinCursor - this.#bufferStart;
361 if (trimCount > 0) {
362 this.#buffer.trimFront(trimCount);
363 this.#bufferStart = this.#cachedMinCursor;
364 for (let i = 0; i < this.#pullWaiters.length; i++) {
365 this.#pullWaiters[i]();
366 }
367 this.#pullWaiters = [];
368 }
369 }
370
371 #recomputeMinCursor() {
372 const { minCursor, minCursorConsumers } = getMinCursor(

Callers 6

getNextMethod · 0.45
returnMethod · 0.45
throwMethod · 0.45
nextMethod · 0.45
returnMethod · 0.45
throwMethod · 0.45

Calls 2

#recomputeMinCursorMethod · 0.95
trimFrontMethod · 0.80

Tested by

no test coverage detected