aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar lberki <lberki@google.com>2018-02-26 08:03:21 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-02-26 08:05:19 -0800
commit4ee8f5d79f49dd3592e27b43528535b67f449625 (patch)
treec5d8aef6ce84342634e61329ffadaff62395320b
parente1c866d33fc504a0a3dee901e3d0291e23be1227 (diff)
Keep the order of select branches the same as it was in the BUILD file.
This is a change from behavior introduced in unknown commit, which was added to preserve determinism even though the ordering of dicts in Python is non-deterministic. Now that we don't call into Python anymore, this is not necessary. RELNOTES: None (select branches are mutually exclusive, so this is a no-op) PiperOrigin-RevId: 187022575
-rw-r--r--src/main/java/com/google/devtools/build/lib/syntax/SelectorValue.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/SelectorValue.java b/src/main/java/com/google/devtools/build/lib/syntax/SelectorValue.java
index 2ba77d870b..247bfda071 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/SelectorValue.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/SelectorValue.java
@@ -19,7 +19,6 @@ import com.google.devtools.build.lib.skylarkinterface.SkylarkModule;
import com.google.devtools.build.lib.skylarkinterface.SkylarkPrinter;
import com.google.devtools.build.lib.skylarkinterface.SkylarkValue;
import java.util.Map;
-import java.util.TreeMap;
/**
* The value passed to a select({...}) statement, e.g.:
@@ -45,8 +44,7 @@ public final class SelectorValue implements SkylarkValue {
private final String noMatchError;
public SelectorValue(Map<?, ?> dictionary, String noMatchError) {
- // Put the dict through a sorting to avoid depending on insertion order.
- this.dictionary = ImmutableMap.copyOf(new TreeMap<>(dictionary));
+ this.dictionary = ImmutableMap.copyOf(dictionary);
this.type =
dictionary.isEmpty() ? Object.class : Iterables.get(dictionary.values(), 0).getClass();
this.noMatchError = noMatchError;