Skip to content

Commit

Permalink
Remove redundant use of <>
Browse files Browse the repository at this point in the history
`returnProposalDeposits` is never called with duplicate proposals, if it
was we would have been in trouble, because then deposit would be
returned into the treasury multiple times, which would be equivalent to
minting ADA.

Considering that this case is impossible anyways it makes more sense to
use more efficient and safer `insert` instead of `insertWith (<>)`
  • Loading branch information
lehins committed Oct 15, 2024
1 parent 1e5df05 commit c3cf6d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Epoch.hs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ returnProposalDeposits removedProposals oldUMap =
(RewDepUView um)
, unclaimed
)
| otherwise = (um, Map.insertWith (<>) (gasId gas) (gasDeposit gas) unclaimed)
| otherwise = (um, Map.insert (gasId gas) (gasDeposit gas) unclaimed)
addReward c rd =
-- Deposits have been validated at this point
rd {rdReward = rdReward rd <> compactCoinOrError c}
Expand Down

0 comments on commit c3cf6d6

Please sign in to comment.