Skip to content

Commit

Permalink
Merge rust-lang#64
Browse files Browse the repository at this point in the history
64: Inline non-nightly lowest_set_bit_nonzero r=Amanieu a=cuviper

I was surprised to see this tiny function show up in my performance
profile on its own. The nightly version of this function was already
marked `#[inline]`, but the non-nightly version should be inlined too.

Co-authored-by: Josh Stone <[email protected]>
  • Loading branch information
bors[bot] and cuviper committed Apr 16, 2019
2 parents a657af5 + 79c5b41 commit 12e8bb9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/raw/bitmask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ impl BitMask {
pub unsafe fn lowest_set_bit_nonzero(self) -> usize {
intrinsics::cttz_nonzero(self.0) as usize / BITMASK_STRIDE
}
#[inline]
#[cfg(not(feature = "nightly"))]
pub unsafe fn lowest_set_bit_nonzero(self) -> usize {
self.trailing_zeros()
Expand Down

0 comments on commit 12e8bb9

Please sign in to comment.