Skip to content

Commit

Permalink
refactor(transformer): rename AString to ArenaString (#6997)
Browse files Browse the repository at this point in the history
Part of #6996.
  • Loading branch information
overlookmotel committed Oct 29, 2024
1 parent 9fd9f4f commit 63e8bfe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/oxc_transformer/src/common/helper_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ use std::{borrow::Cow, cell::RefCell};
use rustc_hash::FxHashMap;
use serde::Deserialize;

use oxc_allocator::{String as AString, Vec};
use oxc_allocator::{String as ArenaString, Vec};
use oxc_ast::ast::{Argument, CallExpression, Expression, TSTypeParameterInstantiation};
use oxc_semantic::{ReferenceFlags, SymbolFlags};
use oxc_span::{Atom, SPAN};
Expand Down Expand Up @@ -247,7 +247,7 @@ impl<'a> HelperLoaderStore<'a> {

// Construct string directly in arena without an intermediate temp allocation
let len = self.module_name.len() + "/helpers/".len() + helper_name.len();
let mut source = AString::with_capacity_in(len, ctx.ast.allocator);
let mut source = ArenaString::with_capacity_in(len, ctx.ast.allocator);
source.push_str(&self.module_name);
source.push_str("/helpers/");
source.push_str(helper_name);
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_transformer/src/es2022/class_static_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
use itoa::Buffer as ItoaBuffer;

use oxc_allocator::String as AString;
use oxc_allocator::String as ArenaString;
use oxc_ast::{ast::*, Visit, NONE};
use oxc_semantic::SymbolTable;
use oxc_span::SPAN;
Expand Down Expand Up @@ -295,7 +295,7 @@ impl<'a> Keys<'a> {
i += 1;
}

let mut key = AString::with_capacity_in(num_str.len() + 1, ctx.ast.allocator);
let mut key = ArenaString::with_capacity_in(num_str.len() + 1, ctx.ast.allocator);
key.push('_');
key.push_str(num_str);
let key = Atom::from(key.into_bump_str());
Expand Down

0 comments on commit 63e8bfe

Please sign in to comment.