Skip to content

Commit

Permalink
Simplify implementation of TokenMap.add.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Jun 2, 2023
1 parent 1b3b827 commit 57013af
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/primitive/lib/Cardano/Wallet/Primitive/Types/TokenMap.hs
Expand Up @@ -539,10 +539,7 @@ filter f = fromFlatList . L.filter (f . fst) . toFlatList
-- | Adds one token map to another.
--
add :: TokenMap -> TokenMap -> TokenMap
add a b = F.foldl' acc a $ toFlatList b
where
acc c (asset, quantity) =
adjustQuantity c asset (`TokenQuantity.add` quantity)
add = (<>)

-- | Subtracts the second token map from the first.
--
Expand Down

0 comments on commit 57013af

Please sign in to comment.