Skip to content
Myr

Modify loop conditions in checkAscii function

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 3e28403 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:src/util/chars.go+2 added-2 removed
22 unmodified lines
23}2425func checkAscii(bytes []byte) (bool, int) {26 i := 027 for ; i < len(bytes)-8; i += 8 {27 for ; i <= len(bytes)-8; i += 8 {28 if (overflow64 & *(*uint64)(unsafe.Pointer(&bytes[i]))) > 0 {29 return false, i30 }31 }32 for ; i < len(bytes)-4; i += 4 {32 for ; i <= len(bytes)-4; i += 4 {33 if (overflow32 & *(*uint32)(unsafe.Pointer(&bytes[i]))) > 0 {34 return false, i35 }36 }
131 unmodified lines