This code was using bitwise operations to substitute for logical boolean
operators. This is sometimes justified, to avoid the short-circuit behavior of
the logical operators that can impair CPU pre-fetching/speculation. However, in
this situation this code is not on a hot path and the bitwise operators were
just making this code harder to read.
dyp = p->y - topsite->coord.y;
dxp = p->x - topsite->coord.x;
fast = 0;
- if ((!right_of_site & (e->b < 0.0)) |
- (right_of_site & (e->b >= 0.0))) {
+ if ((!right_of_site && e->b < 0.0) || (right_of_site && e->b >= 0.0)) {
above = dyp >= e->b * dxp;
fast = above;
} else {