2021-11-30 14:30:13 +00:00
|
|
|
#[inline(always)]
|
2021-12-30 10:21:54 +00:00
|
|
|
#[cold]
|
|
|
|
pub const fn cold() {}
|
|
|
|
|
|
|
|
#[inline(always)]
|
2021-11-30 14:30:13 +00:00
|
|
|
pub const fn likely(b: bool) -> bool {
|
2021-12-30 10:21:54 +00:00
|
|
|
if !b {
|
|
|
|
cold()
|
2021-11-30 14:30:13 +00:00
|
|
|
}
|
2021-12-30 10:21:54 +00:00
|
|
|
b
|
2021-11-30 14:30:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[inline(always)]
|
|
|
|
pub const fn unlikely(b: bool) -> bool {
|
2021-12-30 10:21:54 +00:00
|
|
|
if b {
|
|
|
|
cold()
|
2021-11-30 14:30:13 +00:00
|
|
|
}
|
2021-12-30 10:21:54 +00:00
|
|
|
b
|
2021-11-30 14:30:13 +00:00
|
|
|
}
|