1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

scanner: small optimization

This commit is contained in:
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

View File

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