From 0ca87ad09f5efd5a4841530ad861f0548f0b337d Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 18 Mar 2022 12:52:03 +0200 Subject: [PATCH] parser: fix small performance regression after 1d83ab6b (by avoiding needless interpolation in hot paths) --- vlib/v/parser/parser.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index 2c93a41cc8..b88b1bb905 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -1943,7 +1943,7 @@ pub fn (mut p Parser) parse_ident(language ast.Language) ast.Ident { p.register_auto_import('sync') } mut_pos := p.tok.pos() - kind_name := '$p.tok.kind' + modifier_kind := p.tok.kind is_mut := p.tok.kind == .key_mut || is_shared || is_atomic if is_mut { p.next() @@ -1958,7 +1958,7 @@ pub fn (mut p Parser) parse_ident(language ast.Language) ast.Ident { } if p.tok.kind != .name { if is_mut || is_static || is_volatile { - p.error_with_pos('the `$kind_name` keyword is invalid here', mut_pos) + p.error_with_pos('the `$modifier_kind` keyword is invalid here', mut_pos) } else { p.error('unexpected token `$p.tok.lit`') }