Fix typo in Math.ternary (#5026)
Signed-off-by: snoppy <michaleli@foxmail.com>
This commit is contained in:
@ -18,7 +18,7 @@ library SignedMath {
|
||||
*/
|
||||
function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {
|
||||
unchecked {
|
||||
// branchless terinary works because:
|
||||
// branchless ternary works because:
|
||||
// b ^ (a ^ b) == a
|
||||
// b ^ 0 == b
|
||||
return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));
|
||||
|
||||
Reference in New Issue
Block a user