Skip to main content

cpu_likely_branch

Function cpu_likely_branch 

Source
pub fn cpu_likely_branch(b: bool) -> bool
Expand description

Hints to the compiler that the branch condition is likely to be true. Returns the value passed to it.

This intrinsic is primarily used with if statements. Using it in other contexts may not have any effect.

Unlike most intrinsics, this function is safe to call and doesn’t require an unsafe block. Therefore, implementations must not require the user to uphold any safety invariants.