From 2064abab401bc8ed9af2a61e9ff1b89d1d95c873 Mon Sep 17 00:00:00 2001 From: Tobias Guggenmos Date: Wed, 8 Jan 2020 15:58:52 +0100 Subject: [PATCH] Cleanup: Remove unused variable (#6581) Signed-off-by: Tobias Guggenmos --- promql/parse.go | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/promql/parse.go b/promql/parse.go index e325f13dc..c1a643494 100644 --- a/promql/parse.go +++ b/promql/parse.go @@ -29,9 +29,8 @@ import ( ) type parser struct { - lex *Lexer - token Item - peeking bool + lex *Lexer + token Item inject Item injecting bool @@ -134,16 +133,12 @@ func (p *parser) typecheck(node Node) (err error) { // next returns the next token. func (p *parser) next() Item { - if !p.peeking { - t := p.lex.NextItem() - // Skip comments. - for t.Typ == COMMENT { - t = p.lex.NextItem() - } - p.token = t + t := p.lex.NextItem() + // Skip comments. + for t.Typ == COMMENT { + t = p.lex.NextItem() } - - p.peeking = false + p.token = t if p.token.Typ == ERROR { p.errorf("%s", p.token.Val)