aboutsummaryrefslogtreecommitdiff
path: root/src/text/template/parse
diff options
context:
space:
mode:
Diffstat (limited to 'src/text/template/parse')
-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
}