Skip to content

Commit d160f7f

Browse files
authored
refactor(hstr): Use default inline strategy (#10954)
1 parent 8cd5c58 commit d160f7f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.changeset/fluffy-rats-play.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
hstr: patch
3+
swc_core: patch
4+
---
5+
6+
refactor(hstr): use default inline strategy

crates/hstr/src/dynamic.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ trait Storage {
174174
}
175175

176176
impl Storage for &'_ mut AtomStore {
177-
#[inline(never)]
178177
fn insert_entry(self, text: &str, hash: u64) -> Item {
179178
// If the text is too long, interning is not worth it.
180179
if text.len() > 512 {
@@ -203,7 +202,7 @@ impl Storage for &'_ mut AtomStore {
203202
}
204203
}
205204

206-
#[inline(never)]
205+
#[inline(always)]
207206
fn calc_hash(text: &str) -> u64 {
208207
let mut hasher = FxHasher::default();
209208
text.hash(&mut hasher);

crates/hstr/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ impl Atom {
252252
}
253253

254254
impl Atom {
255-
#[inline(never)]
256255
fn get_hash(&self) -> u64 {
257256
match self.tag() {
258257
DYNAMIC_TAG => {
@@ -270,7 +269,6 @@ impl Atom {
270269
}
271270
}
272271

273-
#[inline(never)]
274272
fn as_str(&self) -> &str {
275273
match self.tag() {
276274
DYNAMIC_TAG => unsafe {

0 commit comments

Comments
 (0)