scanner: small optimization

pull/4174/head
yuyi 2020-04-01 18:11:52 +08:00 committed by GitHub
parent 9bb1b5d1bb
commit b28e372106
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -994,8 +994,9 @@ fn (s Scanner) line(n int) string {
return res.trim_right('\r\n').trim_left('\r\n')
}
[inline]
fn is_name_char(c byte) bool {
return c == `_` || c.is_letter()
return (c >= `a` && c <= `z`) || (c >= `A` && c <= `Z`) || c == `_`
}
[inline]