Browse Source
During a review of the class, Josh Bloch pointed out we can use "i = (i + 1) & mask" to wrap around at the end of the table, instead of a conditional with a branch. This is generally faster due to one less branch that will be mis-predicted by the CPU. Change-Id: Ic88c00455ebc6adde9708563a6ad4d0377442bba Signed-off-by: Shawn O. Pearce <spearce@spearce.org>stable-0.12
Shawn O. Pearce
14 years ago
1 changed files with 10 additions and 14 deletions
Loading…
Reference in new issue