MCPcopy Create free account
hub / github.com/nodejs/node / dropConsumedChunks

Method dropConsumedChunks

deps/undici/undici.js:16631–16644  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16629 this.dropConsumedChunks();
16630 }
16631 dropConsumedChunks() {
16632 while (this.lineChunkIndex > 0) {
16633 this.chunks.shift();
16634 this.lineChunkIndex--;
16635 this.chunkIndex--;
16636 }
16637 if (this.chunkIndex === this.chunks.length) {
16638 this.chunks.length = 0;
16639 this.chunkIndex = 0;
16640 this.pos = 0;
16641 this.lineChunkIndex = 0;
16642 this.linePos = 0;
16643 }
16644 }
16645 readLine() {
16646 if (this.lineChunkIndex === this.chunkIndex) {
16647 return this.chunks[this.chunkIndex].subarray(this.linePos, this.pos);

Callers 2

syncLineStartToCursorMethod · 0.45
discardLeadingBytesMethod · 0.45

Calls 1

shiftMethod · 0.45

Tested by

no test coverage detected