From: griesemer
Date: Tue, 17 Oct 2017 22:30:12 +0000 (-0700)
Subject: spec: simplify paragraph on certain range expressions over arrays
X-Git-Tag: go1.10beta1~664
X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ada655759393e30ae25296b94c5cc07b27a4d683;p=gostls13.git
spec: simplify paragraph on certain range expressions over arrays
Fixes #22258.
Change-Id: I43e68f1cf3163e1a041ebff2734ff2cb7943f695
Reviewed-on: https://go-review.googlesource.com/71431
Reviewed-by: Rob Pike
Reviewed-by: Matthew Dempsky
Reviewed-by: Ian Lance Taylor
---
diff --git a/doc/go_spec.html b/doc/go_spec.html
index 6189db5ee6..fd3830dcf0 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -5028,12 +5028,10 @@ the range clause is equivalent to the same clause without that identifier.
-The range expression is evaluated once before beginning the loop,
-with one exception: if the range expression is an array or a pointer to an array
-and at most one iteration variable is present, only the range expression's
-length is evaluated; if that length is constant,
-by definition
-the range expression itself will not be evaluated.
+The range expression x
is evaluated once before beginning the loop,
+with one exception: if at most one iteration variable is present and
+len(x)
is constant,
+the range expression is not evaluated.