Skip to content

Commit

Permalink
Simplified getRunes()
Browse files Browse the repository at this point in the history
  • Loading branch information
dop251 committed Aug 6, 2020
1 parent 4a0a6ac commit 5b52bb1
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions regexp.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,7 @@ func (re *Regexp) getRunesAndStart(s string, startAt int) ([]rune, int) {
}

func getRunes(s string) []rune {
ret := make([]rune, len(s))
i := 0
for _, r := range s {
ret[i] = r
i++
}
return ret[:i]
return []rune(s)
}

// MatchRunes return true if the runes matches the regex
Expand Down

0 comments on commit 5b52bb1

Please sign in to comment.