From b28e3721069272664b9cfaaed2eb71305332ee7c Mon Sep 17 00:00:00 2001 From: yuyi Date: Wed, 1 Apr 2020 18:11:52 +0800 Subject: [PATCH] scanner: small optimization --- vlib/v/scanner/scanner.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/v/scanner/scanner.v b/vlib/v/scanner/scanner.v index d7fb9c0ea7..8b67cf9d89 100644 --- a/vlib/v/scanner/scanner.v +++ b/vlib/v/scanner/scanner.v @@ -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]