aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-02-06 21:31:27 +0000
committerGinger Bill <bill@gingerbill.org>2017-02-06 21:31:27 +0000
commitdf78b8ad3ebd263849eee6736fd78efe017522a4 (patch)
treea1325cba9a7664bcd76b33eb7d9ac8cea6774bf6 /code
parentf11d73ffaa5df21437714e73bb72352ed17d57a9 (diff)
Make checking map key exists optional
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin4
1 files changed, 2 insertions, 2 deletions
diff --git a/code/demo.odin b/code/demo.odin
index c4e44aebd..90ac11858 100644
--- a/code/demo.odin
+++ b/code/demo.odin
@@ -18,14 +18,14 @@ main :: proc() {
m["a"] = 56;
m["b"] = 13453;
m["c"] = 7654;
- c, ok := m["c"];
+ c := m["c"];
+ _, ok := m["c"];
assert(ok && c == 7654);
for val, key in m {
fmt.printf("m[\"%s\"] == %v\n", key, val);
}
-
// fm: map[128, int]f32;
/*