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:
Lohann Paterno Coutinho Ferreira
2024-04-23 13:08:08 +01:00
committed by GitHub
parent 60afc99053
commit 4032b42694
5 changed files with 66 additions and 7 deletions

View File

@ -0,0 +1,5 @@
---
'openzeppelin-solidity': minor
---
`Math`, `SignedMath`: Add a branchless `ternary` function that computes`cond ? a : b` in constant gas cost.