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

Method shift

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

* Removes and returns the first item in the buffer.

()

Source from the content-addressed store, hash-verified

146 * Removes and returns the first item in the buffer.
147 */
148 shift(): T {
149 if (this.isEmpty()) {
150 throw new RangeError('Ring buffer is empty.');
151 }
152 const result = this.get(this.begin);
153 this.set(this.begin, undefined);
154 this.begin = this.wrap(this.begin + 1);
155 return result;
156 }
157
158 /**
159 * Removes and returns a specific item in the buffer, and moves the last item

Callers 8

serialNextFunction · 0.80
nextMethod · 0.80
parseHeadersFunction · 0.80
acquireTextureMethod · 0.80
mainFunction · 0.80
runMethod · 0.80
exitFrameMethod · 0.80

Calls 4

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

Tested by

no test coverage detected