|
|
|
|
|
by yarg
1146 days ago
|
|
You have to do some really weird shit if you want generalised branchless ternary statements. begin += (arr[step+begin] < value)?step:0;
Something like: int mask = ((arr[step + begin] - value) >> 31); //Depends on signed shift
begin += (step & mask) | (0 & ~mask);
(Obviously in this case, it's simplifiable.) |
|