Branchless ternary, min and max methods (#4976)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com> Co-authored-by: Ernesto García <ernestognw@gmail.com>
This commit is contained in:
committed by
GitHub
parent
60afc99053
commit
4032b42694
5
.changeset/spotty-falcons-explain.md
Normal file
5
.changeset/spotty-falcons-explain.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`Math`, `SignedMath`: Add a branchless `ternary` function that computes`cond ? a : b` in constant gas cost.
|
||||
Reference in New Issue
Block a user