MCPcopy Create free account
hub / github.com/nodejs/node / #tryTrimBuffer

Method #tryTrimBuffer

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

Source from the content-addressed store, hash-verified

607 }
608
609 #tryTrimBuffer() {
610 if (this.#cachedMinCursorConsumers === 0) {
611 this.#recomputeMinCursor();
612 }
613 const trimCount = this.#cachedMinCursor - this.#bufferStart;
614 if (trimCount > 0) {
615 this.#buffer.trimFront(trimCount);
616 this.#bufferStart = this.#cachedMinCursor;
617 }
618 }
619
620 #recomputeMinCursor() {
621 const { minCursor, minCursorConsumers } = getMinCursor(

Callers

nothing calls this directly

Calls 2

#recomputeMinCursorMethod · 0.95
trimFrontMethod · 0.80

Tested by

no test coverage detected