MCPcopy Index your code
hub / github.com/nodejs/node / clear

Method clear

lib/internal/streams/iter/ringbuffer.js:128–134  ·  view source on GitHub ↗

* Remove all items. O(n) for GC cleanup.

()

Source from the content-addressed store, hash-verified

126 * Remove all items. O(n) for GC cleanup.
127 */
128 clear() {
129 for (let i = 0; i < this.#size; i++) {
130 this.#backing[(this.#head + i) & this.#mask] = undefined;
131 }
132 this.#head = 0;
133 this.#size = 0;
134 }
135
136 /**
137 * Double the backing capacity, linearizing the circular layout.

Callers 1

trimFrontMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected