Browse Source

promql: Eliminate dead code (#6215)

peek() already ensures to not return a ItemComment so checking for this
is redundant.

Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
pull/6224/head
Tobias Guggenmos 5 years ago committed by Julius Volz
parent
commit
fe80cf4734
  1. 3
      promql/parse.go

3
promql/parse.go

@ -106,9 +106,6 @@ func (p *parser) parseExpr() (expr Expr, err error) {
defer p.recover(&err) defer p.recover(&err)
for p.peek().typ != ItemEOF { for p.peek().typ != ItemEOF {
if p.peek().typ == ItemComment {
continue
}
if expr != nil { if expr != nil {
p.errorf("could not parse remaining input %.15q...", p.lex.input[p.lex.lastPos:]) p.errorf("could not parse remaining input %.15q...", p.lex.input[p.lex.lastPos:])
} }

Loading…
Cancel
Save