MCPcopy Create free account
hub / github.com/bazelbuild/bazel / build

Method build

src/main/java/net/starlark/java/eval/Dict.java:540–553  ·  view source on GitHub ↗

Returns a new Dict containing the entries added so far. The result has the specified mutability; null means immutable.

(@Nullable Mutability mu)

Source from the content-addressed store, hash-verified

538 * mutability; null means immutable.
539 */
540 public Dict<K, V> build(@Nullable Mutability mu) {
541 if (mu == null) {
542 mu = Mutability.IMMUTABLE;
543 }
544
545 if (mu == Mutability.IMMUTABLE) {
546 if (items.isEmpty()) {
547 return empty();
548 }
549 return new Dict<>(buildImmutableMap());
550 } else {
551 return new Dict<>(mu, buildLinkedHashMap());
552 }
553 }
554
555 private void populateMap(int n, BiConsumer<K, V> mapEntryConsumer) {
556 for (int i = 0; i < n; i++) {

Callers 15

buildImmutableMethod · 0.95
GcClass · 0.45
mainMethod · 0.45
enumListMethod · 0.45
setParserMethod · 0.45
prefixedWithNoMethod · 0.45

Calls 4

buildImmutableMapMethod · 0.95
buildLinkedHashMapMethod · 0.95
isEmptyMethod · 0.45
emptyMethod · 0.45