aboutsummaryrefslogtreecommitdiff
path: root/src/text/template/parse/parse.go
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2019-10-04 16:55:52 -0400
committerCherry Zhang <cherryyz@google.com>2019-10-04 16:55:52 -0400
commitb0d930577ebe86d0dbd6d3f4bf551a4e4ff1fcde (patch)
treec1382943d8874ef6f278b1b49d38b4a5090993a8 /src/text/template/parse/parse.go
parente63c1df34856fbf61f72fef84f810cf3306ec204 (diff)
parentc450ace12c657e3953d79975c04f51605395cd50 (diff)
downloadgo-b0d930577ebe86d0dbd6d3f4bf551a4e4ff1fcde.tar.xz
[dev.link] all: merge branch 'master' into dev.link
Weekly merge. Change-Id: I98c6121f04f347df2788ac5eaf99afad5da4a039
Diffstat (limited to 'src/text/template/parse/parse.go')
-rw-r--r--src/text/template/parse/parse.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/text/template/parse/parse.go b/src/text/template/parse/parse.go
index 7c35b0ff3d..c9b80f4a24 100644
--- a/src/text/template/parse/parse.go
+++ b/src/text/template/parse/parse.go
@@ -108,13 +108,8 @@ func (t *Tree) nextNonSpace() (token item) {
}
// peekNonSpace returns but does not consume the next non-space token.
-func (t *Tree) peekNonSpace() (token item) {
- for {
- token = t.next()
- if token.typ != itemSpace {
- break
- }
- }
+func (t *Tree) peekNonSpace() item {
+ token := t.nextNonSpace()
t.backup()
return token
}