From ada655759393e30ae25296b94c5cc07b27a4d683 Mon Sep 17 00:00:00 2001 From: griesemer Date: Tue, 17 Oct 2017 15:30:12 -0700 Subject: [PATCH] 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 --- doc/go_spec.html | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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.

-- 2.48.1