From c5297e082854a0c1b02a81cd1b4333c4fd239f9f Mon Sep 17 00:00:00 2001 From: Alexey Kuleshevich Date: Tue, 15 Oct 2024 15:57:08 -0600 Subject: [PATCH] Remove redundant use of `<>` `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 (<>)` --- eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Epoch.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Epoch.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Epoch.hs index af9c2269763..2e41218ccf1 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Epoch.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Epoch.hs @@ -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}