MCPcopy Index your code
hub / github.com/bazelbuild/bazel / concat

Method concat

src/main/java/net/starlark/java/eval/Tuple.java:105–121  ·  view source on GitHub ↗

Returns a tuple that is the concatenation of two tuples.

(Tuple x, Tuple y)

Source from the content-addressed store, hash-verified

103
104 /** Returns a tuple that is the concatenation of two tuples. */
105 public static Tuple concat(Tuple x, Tuple y) {
106 if (x.isEmpty()) {
107 return y;
108 } else if (y.isEmpty()) {
109 return x;
110 } else {
111 Object[] xelems =
112 x instanceof SingletonTuple
113 ? new Object[] {((SingletonTuple) x).elem}
114 : ((RegularTuple) x).elems;
115 Object[] yelems =
116 y instanceof SingletonTuple
117 ? new Object[] {((SingletonTuple) y).elem}
118 : ((RegularTuple) y).elems;
119 return wrap(ObjectArrays.concat(xelems, yelems, Object.class));
120 }
121 }
122
123 @Override
124 public int compareTo(Tuple that) {

Callers 6

binaryOpMethod · 0.95
getUsageMethod · 0.45
getUsageHtmlMethod · 0.45
searchtools.jsFile · 0.45
jquery.jsFile · 0.45
underscore.jsFile · 0.45

Calls 2

wrapMethod · 0.95
isEmptyMethod · 0.45

Tested by

no test coverage detected