Fix typo in Math.ternary (#5026)

Signed-off-by: snoppy <michaleli@foxmail.com>
This commit is contained in:
Snoppy
2024-04-26 02:04:34 +08:00
committed by GitHub
parent 4032b42694
commit 60697cb09a

View File

@ -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)));