From: Shenghou Ma Date: Thu, 17 Jan 2013 15:11:25 +0000 (+0800) Subject: doc/go_spec.html: clarification about insertion during map iteration X-Git-Tag: go1.1rc2~1375 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ced57153df76f501b3f9b7efdc974c0725bcd594;p=gostls13.git doc/go_spec.html: clarification about insertion during map iteration R=mdempsky, iant, r, gri, rsc, ken CC=golang-dev https://golang.org/cl/7100046 --- diff --git a/doc/go_spec.html b/doc/go_spec.html index 7a2a00670b..0309209c2a 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -4382,7 +4382,7 @@ Range expression 1st value 2nd value (if 2nd v array or slice a [n]E, *[n]E, or []E index i int a[i] E string s string type index i int see below rune map m map[K]V key k K m[k] V -channel c chan E, <-chan E element e E +channel c chan E, <-chan E element e E
    @@ -4408,11 +4408,12 @@ a single byte in the string.
  1. The iteration order over maps is not specified and is not guaranteed to be the same from one iteration to the next. -If map entries that have not yet been reached are deleted during iteration, +If map entries that have not yet been reached are removed during iteration, the corresponding iteration values will not be produced. If map entries are -inserted during iteration, the behavior is implementation-dependent, but the -iteration values for each entry will be produced at most once. If the map -is nil, the number of iterations is 0. +created during iteration, that entry may be produced during the iteration or +may be skipped. The choice may vary for each entry created and from one +iteration to the next. +If the map is nil, the number of iterations is 0.