Skip to content

Commit

Permalink
Tweak a Note
Browse files Browse the repository at this point in the history
  • Loading branch information
effectfully committed Oct 18, 2023
1 parent 13d9882 commit 45817e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plutus-ledger-api/src/PlutusLedgerApi/V1/Value.hs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ We check equality of values of two key-value pairs right after ensuring that the
disadvantageous if the values are big and there's a key that is present in one of the lists but not
in the other, since in that case computing equality of values was expensive and pointless. However
1. we don't really know whether this can be a common situation
1. we've checked and on the chain 'Value's very rarely have more than 3 constructors, so we optimize
for the most common use case
2. computing equality of values before ensuring equality of all the keys certainly does help when we
check equality of 'TokenName'-value pairs, since the value of a 'TokenName' is an 'Integer' and
@(==) :: Integer -> Integer -> Bool@ is generally much faster than repeatedly searching for keys
Expand Down

0 comments on commit 45817e8

Please sign in to comment.