Commit e781303e authored by Ken Thompson's avatar Ken Thompson

maps access to a missing key

will return the "zero" value

R=rsc
CC=golang-dev
https://golang.org/cl/700041
parent 66caa38d
......@@ -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=");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment