From be19d4bca3e12fa8a46a35fa300a8a46f6fd202c Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Wed, 6 Jun 2018 02:48:52 +0200 Subject: ContainsRune --- lexer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lexer.go') diff --git a/lexer.go b/lexer.go index 704c32c..0c6f982 100644 --- a/lexer.go +++ b/lexer.go @@ -157,7 +157,7 @@ func (y *yyLex) acceptRune(valid ...rune) bool { } func (y *yyLex) accept(valid string) bool { - if strings.IndexRune(valid, y.next()) >= 0 { + if strings.ContainsRune(valid, y.next()) { return true } y.backup() @@ -165,7 +165,7 @@ func (y *yyLex) accept(valid string) bool { } func (y *yyLex) acceptRun(valid string) { - for strings.IndexRune(valid, y.next()) >= 0 { + for strings.ContainsRune(valid, y.next()) { } y.backup() } -- cgit v1.2.3