feat: lots of optimization

* allocate vm stack on the stack
* use Rc instead of Arc
* optimize recursive attribute set
This commit is contained in:
2025-05-11 12:57:29 +08:00
parent 07b486848f
commit 05e82d4021
12 changed files with 137 additions and 111 deletions

View File

@@ -695,7 +695,9 @@ fn downgrade_attr(attr: ast::Attr, ctx: &mut DowngradeContext) -> Result<Attr> {
Ident(ident) => Ok(Attr::Str(ident.to_string().into())),
Str(string) => {
let parts = string.normalized_parts();
if parts.len() == 1 {
if parts.len() == 0 {
Ok(Attr::Str("".into()))
} else if parts.len() == 1 {
match parts.into_iter().next().unwrap() {
Literal(ident) => Ok(Attr::Str(ident.into())),
Interpolation(interpol) => {