gnosis / conditional-tokens-contracts

Smart contracts for conditional tokens.
GNU Lesser General Public License v3.0
163 stars 64 forks source link

Optimization in ConditionalTokens's prepareCondition #95

Open remedcu opened 4 years ago

remedcu commented 4 years ago

Line 67 in ConditionalToken can be rewritten as:

require(outcomeSlotCount < 257, "too many outcome slots");

Where the <= part can be optimized with just a single comparison, rather than to do two comparisons (under the hood)