aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/syntax
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2018-07-18 03:13:55 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-07-18 03:15:12 -0700
commitf6ea8e456fa549b69686cefa4b44d6ada1474410 (patch)
tree232274993fadc971b9c4a730138b1cafc1cfa635 /src/main/java/com/google/devtools/build/lib/syntax
parent56de7d347c6d342400d3a95b181525dabb733207 (diff)
If a dictionary is used as a general set, the keys should be mapped to `True` instead of `None`.
dict has a get() method that defaults to `None`. Checking for a key in the dictionary with get() will always return `None` in the given example. Using `True` is better. RELNOTES: None. PiperOrigin-RevId: 205052981
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/syntax')
-rw-r--r--src/main/java/com/google/devtools/build/lib/syntax/SkylarkNestedSet.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkNestedSet.java b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkNestedSet.java
index d5c60f8508..c31908f0b5 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkNestedSet.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkNestedSet.java
@@ -53,7 +53,7 @@ import javax.annotation.Nullable;
+ "<p>"
+ "Depsets are not implemented as hash sets and do not support fast membership tests. If "
+ "you need a general set datatype, you can simulate one using a dictionary where all "
- + "keys map to <code>None</code>."
+ + "keys map to <code>True</code>."
+ "<p>"
+ "Depsets are immutable. They should be created using their "
+ "<a href=\"globals.html#depset\">constructor function</a> and merged or augmented with "