From 235e6c554b4788e191171d0fabb1165bbe6b1828 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Fri, 1 Apr 2016 10:35:00 +0200 Subject: [PATCH] Use ContainsRune --- promql/lex.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/promql/lex.go b/promql/lex.go index 5d390ca11..743a528d6 100644 --- a/promql/lex.go +++ b/promql/lex.go @@ -341,7 +341,7 @@ func (l *lexer) ignore() { // accept consumes the next rune if it's from the valid set. func (l *lexer) accept(valid string) bool { - if strings.IndexRune(valid, l.next()) >= 0 { + if strings.ContainsRune(valid, l.next()) { return true } l.backup() @@ -350,7 +350,7 @@ func (l *lexer) accept(valid string) bool { // acceptRun consumes a run of runes from the valid set. func (l *lexer) acceptRun(valid string) { - for strings.IndexRune(valid, l.next()) >= 0 { + for strings.ContainsRune(valid, l.next()) { // consume } l.backup()