aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/hashmap.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-03-23 18:32:37 -0700
committerRuss Cox <rsc@golang.org>2009-03-23 18:32:37 -0700
commit86145611b0ad8c6ef6923f65f8a4fd39f07f69d7 (patch)
tree0082f9d1b1e6adb4db63f2430cd84f8f82cd4ff6 /src/runtime/hashmap.c
parent8d44052b6dd9e27a5230f66239681cec601d3a8e (diff)
downloadgo-86145611b0ad8c6ef6923f65f8a4fd39f07f69d7.tar.xz
allow range on nil maps
R=ken OCL=26663 CL=26663
Diffstat (limited to 'src/runtime/hashmap.c')
-rw-r--r--src/runtime/hashmap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/hashmap.c b/src/runtime/hashmap.c
index bb8dd7ba98..b3022ca149 100644
--- a/src/runtime/hashmap.c
+++ b/src/runtime/hashmap.c
@@ -870,6 +870,10 @@ sys·mapassign2(Hmap *h, ...)
void
sys·mapiterinit(Hmap *h, struct hash_iter *it)
{
+ if(h == nil) {
+ it->data = nil;
+ return;
+ }
hash_iter_init(h, it);
it->data = hash_next(it);
if(debug) {