Improve performance skipWhiteSpace

This commit is contained in:
Masaaki Goshima 2020-05-07 13:44:41 +09:00
parent f198ef6517
commit 4201966ee1
1 changed files with 5 additions and 7 deletions

View File

@ -12,12 +12,10 @@ func init() {
} }
func skipWhiteSpace(buf []byte, cursor int) int { func skipWhiteSpace(buf []byte, cursor int) int {
buflen := len(buf) LOOP:
for ; cursor < buflen; cursor++ { if isWhiteSpace[buf[cursor]] {
if isWhiteSpace[buf[cursor]] { cursor++
continue goto LOOP
}
return cursor
} }
return buflen return cursor
} }