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

scanner: minor optimization in text_scan() (#7172)

This commit is contained in:
yuyi 2020-12-07 13:33:41 +08:00 committed by GitHub
parent 14887304d8
commit f377710c0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -532,8 +532,9 @@ fn (mut s Scanner) text_scan() token.Token {
// }
if s.is_started {
s.pos++
} else {
s.is_started = true
}
s.is_started = true
if s.pos >= s.text.len {
return s.end_of_file()
}