in reply to Re: Optimizing a sort function (wrap-around alpha)
in thread Optimizing a sort function (wrap-around alpha)
Technically, each of those lt's should be a ternary operation, because values for true could be different.
How about using ! xor instead of == ?
!(($a lt $pick) xor ($b lt $pick)) ? ...
Update: Alternatively, you could "booleanize" each side of the comparison with !:
Hmmm, I think ! xor is clearer; it's the "semantically correct" way to test two booleans for equality.( !($a lt $pick) == !($b lt $pick) ) ? ...
the lowliest monk
|
|---|