ast:remove cached_name, as auto_str_methods free it

This commit is contained in:
kbkpbot 2025-08-11 16:00:40 +08:00
parent 350747793b
commit 57e827a832
2 changed files with 1 additions and 8 deletions

View file

@ -1094,7 +1094,6 @@ pub mut:
mod string mod string
name string name string
full_name string full_name string
cached_name string
kind IdentKind kind IdentKind
info IdentInfo info IdentInfo
is_mut bool // if mut *token* is before name. Use `is_mut()` to lookup mut variable is_mut bool // if mut *token* is before name. Use `is_mut()` to lookup mut variable

View file

@ -525,13 +525,7 @@ pub fn (x &Expr) str() string {
return 'spawn ${x.call_expr}' return 'spawn ${x.call_expr}'
} }
Ident { Ident {
if x.cached_name != '' { return x.name.clone()
return x.cached_name
}
unsafe {
x.cached_name = util.strip_main_name(x.name.clone())
}
return x.cached_name
} }
IfExpr { IfExpr {
mut parts := []string{} mut parts := []string{}