solar_data_structures/hint.rs
1#[cfg(not(feature = "nightly"))]
2pub use std::convert::{identity as likely, identity as unlikely};
3
4/// See [`std::hint::likely`].
5#[cfg(feature = "nightly")]
6#[inline(always)]
7pub fn likely(b: bool) -> bool {
8 std::hint::likely(b)
9}
10
11/// See [`std::hint::unlikely`].
12#[cfg(feature = "nightly")]
13#[inline(always)]
14pub fn unlikely(b: bool) -> bool {
15 std::hint::unlikely(b)
16}