Skip to content

Commit 0abec51

Browse files
committed
ensure masking logic is always inlined
1 parent 04e2b2d commit 0abec51

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

crates/bevy_ecs/src/identifier/masks.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,37 @@ pub(crate) struct IdentifierMask;
1313

1414
impl IdentifierMask {
1515
/// Returns the low component from a `u64` value
16-
#[inline]
16+
#[inline(always)]
1717
pub(crate) const fn get_low(value: u64) -> u32 {
1818
(value & LOW_MASK) as u32
1919
}
2020

2121
/// Returns the high component from a `u64` value
22-
#[inline]
22+
#[inline(always)]
2323
pub(crate) const fn get_high(value: u64) -> u32 {
2424
((value & !LOW_MASK) >> u32::BITS) as u32
2525
}
2626

2727
/// Pack a low and high `u32` values into a single `u64` value.
28-
#[inline]
28+
#[inline(always)]
2929
pub(crate) const fn pack_into_u64(low: u32, high: u32) -> u64 {
3030
((high as u64) << u32::BITS) | (low as u64)
3131
}
3232

3333
/// Pack the [`IdKind`] bits into a high segment.
34-
#[inline]
34+
#[inline(always)]
3535
pub(crate) const fn pack_kind_into_high(value: u32, kind: IdKind) -> u32 {
3636
value | ((kind as u32) << 24)
3737
}
3838

3939
/// Extract the value component from a high segment of an [`super::Identifier`].
40-
#[inline]
40+
#[inline(always)]
4141
pub(crate) const fn extract_value_from_high(value: u32) -> u32 {
4242
value & HIGH_MASK
4343
}
4444

4545
/// Extract the ID kind component from a high segment of an [`super::Identifier`].
46-
#[inline]
46+
#[inline(always)]
4747
pub(crate) const fn extract_kind_from_high(value: u32) -> IdKind {
4848
// The negated HIGH_MASK will extract just the bit we need for kind.
4949
let kind_mask = !HIGH_MASK;

0 commit comments

Comments
 (0)