scanner: minor optimization (#4211)
parent
6b9bf8cbf7
commit
5e6aa5371a
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue