qoi/src/utils.rs
2021-12-31 02:01:24 +03:00

21 lines
265 B
Rust

#[inline(always)]
#[cold]
pub const fn cold() {}
#[inline(always)]
#[allow(unused)]
pub const fn likely(b: bool) -> bool {
if !b {
cold()
}
b
}
#[inline(always)]
pub const fn unlikely(b: bool) -> bool {
if b {
cold()
}
b
}