mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
scanner: minor optimization (#4211)
This commit is contained in:
@@ -380,10 +380,8 @@ pub fn (s mut Scanner) scan() token.Token {
|
|||||||
}
|
}
|
||||||
// handle each char
|
// handle each char
|
||||||
c := s.text[s.pos]
|
c := s.text[s.pos]
|
||||||
mut nextc := `\0`
|
nextc := if s.pos + 1 < s.text.len { s.text[s.pos + 1] } else { `\0` }
|
||||||
if s.pos + 1 < s.text.len {
|
|
||||||
nextc = s.text[s.pos + 1]
|
|
||||||
}
|
|
||||||
// name or keyword
|
// name or keyword
|
||||||
if is_name_char(c) {
|
if is_name_char(c) {
|
||||||
name := s.ident_name()
|
name := s.ident_name()
|
||||||
|
|||||||
Reference in New Issue
Block a user