mirror of
https://github.com/golang/go
synced 2024-11-25 09:57:57 -07:00
maps access to a missing key
will return the "zero" value R=rsc CC=golang-dev https://golang.org/cl/700041
This commit is contained in:
parent
66caa38d49
commit
e781303e27
@ -769,8 +769,10 @@ void
|
||||
av = (byte*)&h + h->vo1;
|
||||
|
||||
mapaccess(h, ak, av, &pres);
|
||||
if(!pres)
|
||||
throw("runtime.mapaccess1: key not in map");
|
||||
|
||||
// new spec -- all elements have "zero" value
|
||||
// if(!pres)
|
||||
// throw("runtime.mapaccess1: key not in map");
|
||||
|
||||
if(debug) {
|
||||
prints("runtime.mapaccess1: map=");
|
||||
|
Loading…
Reference in New Issue
Block a user