Skip to content

Commit 5584e76

Browse files
committed
refactor(ast/estree): add #[inline(always)] to ranges methods (#12009)
Add `#[inline(always)]` to these trivial methods.
1 parent 4a408c3 commit 5584e76

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

crates/oxc_estree/src/serialize/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ impl<'s, C: Config, F: Formatter> Serializer for &'s mut ESTreeSerializer<C, F>
180180
type StructSerializer = ESTreeStructSerializer<'s, C, F>;
181181
type SequenceSerializer = ESTreeSequenceSerializer<'s, C, F>;
182182

183+
#[inline(always)]
183184
fn ranges(&self) -> bool {
184185
self.config.ranges()
185186
}

crates/oxc_estree/src/serialize/structs.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ impl<C: Config, F: Formatter> StructSerializer for ESTreeStructSerializer<'_, C,
150150
buffer.print_ascii_byte(b'}');
151151
}
152152

153+
#[inline(always)]
153154
fn ranges(&self) -> bool {
154155
self.serializer.ranges()
155156
}
@@ -223,6 +224,7 @@ impl<'p, P: StructSerializer> Serializer for FlatStructSerializer<'p, P> {
223224
}
224225
}
225226

227+
#[inline(always)]
226228
fn ranges(&self) -> bool {
227229
self.0.ranges()
228230
}
@@ -292,6 +294,7 @@ impl<P: StructSerializer> StructSerializer for FlatStructSerializer<'_, P> {
292294
// No-op - there may be more fields to be added to the struct in the parent
293295
}
294296

297+
#[inline(always)]
295298
fn ranges(&self) -> bool {
296299
self.0.ranges()
297300
}

0 commit comments

Comments
 (0)