MCPcopy
hub / github.com/bazelbuild/bazel / push

Method push

src/main/java/net/starlark/java/eval/Printer.java:262–277  ·  view source on GitHub ↗
(Object x)

Source from the content-addressed store, hash-verified

260
261 // Reports whether x is already present on the visitation stack, pushing it if not.
262 private boolean push(Object x) {
263 // cyclic?
264 for (int i = 0; i < depth; i++) {
265 if (x == stack[i]) {
266 return false;
267 }
268 }
269
270 if (stack == null) {
271 this.stack = new Object[4];
272 } else if (depth == stack.length) {
273 this.stack = Arrays.copyOf(stack, 2 * stack.length);
274 }
275 this.stack[depth++] = x;
276 return true;
277 }
278
279 private void pop() {
280 this.stack[--depth] = null;

Callers 7

reprMethod · 0.95
LexerMethod · 0.45
computeIndentationMethod · 0.45
fastcallMethod · 0.45
positionalOnlyCallMethod · 0.45
pushCallableAndThrowMethod · 0.45

Calls 1

copyOfMethod · 0.45

Tested by

no test coverage detected