Merge pull request #1516 from prometheus/fabxc/rune

Use ContainsRune
This commit is contained in:
Brian Brazil 2016-04-01 09:39:25 +01:00
commit 6aef22d68a

View file

@ -341,7 +341,7 @@ func (l *lexer) ignore() {
// accept consumes the next rune if it's from the valid set. // accept consumes the next rune if it's from the valid set.
func (l *lexer) accept(valid string) bool { func (l *lexer) accept(valid string) bool {
if strings.IndexRune(valid, l.next()) >= 0 { if strings.ContainsRune(valid, l.next()) {
return true return true
} }
l.backup() l.backup()
@ -350,7 +350,7 @@ func (l *lexer) accept(valid string) bool {
// acceptRun consumes a run of runes from the valid set. // acceptRun consumes a run of runes from the valid set.
func (l *lexer) acceptRun(valid string) { func (l *lexer) acceptRun(valid string) {
for strings.IndexRune(valid, l.next()) >= 0 { for strings.ContainsRune(valid, l.next()) {
// consume // consume
} }
l.backup() l.backup()