MCPcopy
hub / github.com/tensorflow/tfjs / pop

Method pop

tfjs-data/src/util/ring_buffer.ts:124–132  ·  view source on GitHub ↗

* Removes and returns the last item in the buffer.

()

Source from the content-addressed store, hash-verified

122 * Removes and returns the last item in the buffer.
123 */
124 pop(): T {
125 if (this.isEmpty()) {
126 throw new RangeError('Ring buffer is empty.');
127 }
128 this.end = this.wrap(this.end - 1);
129 const result = this.get(this.end);
130 this.set(this.end, undefined);
131 return result;
132 }
133
134 /**
135 * Adds an item to the beginning of the buffer.

Callers 2

shuffleExciseMethod · 0.95

Calls 4

isEmptyMethod · 0.95
wrapMethod · 0.95
getMethod · 0.95
setMethod · 0.95

Tested by

no test coverage detected