Add #[inline] to some new functions

Co-authored-by: Camille Gillot <gillot.camille@gmail.com>
This commit is contained in:
Ben Kimock 2023-04-18 14:13:19 -04:00 committed by GitHub
parent a04c09ade8
commit 073d99b25d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 0 deletions

View File

@ -14,12 +14,14 @@ pub trait FingerprintComponent {
} }
impl FingerprintComponent for Hash64 { impl FingerprintComponent for Hash64 {
#[inline]
fn as_u64(&self) -> u64 { fn as_u64(&self) -> u64 {
Hash64::as_u64(*self) Hash64::as_u64(*self)
} }
} }
impl FingerprintComponent for u64 { impl FingerprintComponent for u64 {
#[inline]
fn as_u64(&self) -> u64 { fn as_u64(&self) -> u64 {
*self *self
} }

View File

@ -36,6 +36,7 @@ pub fn as_u64(self) -> u64 {
} }
impl BitXorAssign<u64> for Hash64 { impl BitXorAssign<u64> for Hash64 {
#[inline]
fn bitxor_assign(&mut self, rhs: u64) { fn bitxor_assign(&mut self, rhs: u64) {
self.inner ^= rhs; self.inner ^= rhs;
} }

View File

@ -186,6 +186,7 @@ pub fn new(crate_name: Symbol, is_exe: bool, mut metadata: Vec<String>) -> Stabl
StableCrateId(hasher.finish()) StableCrateId(hasher.finish())
} }
#[inline]
pub fn as_u64(self) -> u64 { pub fn as_u64(self) -> u64 {
self.0.as_u64() self.0.as_u64()
} }