Skip to content
Permalink
Browse files

use foldl to apply node ops as it is left associative

  • Loading branch information...
KtorZ committed Oct 9, 2019
1 parent 4900fcc commit 19db154e4dc98b49b3110ba345c47b505f21788f
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/jormungandr/test/unit/Cardano/Wallet/Jormungandr/NetworkSpec.hs
@@ -47,7 +47,7 @@ import Data.Functor
import Data.Functor.Identity
( Identity (..) )
import Data.List
( intersect, nub, zip4, (\\) )
( foldl', intersect, nub, zip4, (\\) )
import Data.Map
( Map )
import Data.Maybe
@@ -373,7 +373,7 @@ applyNodeOp (NodeGarbageCollect hs) = nodeGarbageCollect hs

-- | apply one batch of operations
applyNodeOps :: [NodeOp] -> Node -> Node
applyNodeOps ops n = foldr applyNodeOp n ops
applyNodeOps ops n = foldl' (flip applyNodeOp) n ops

-- | Add blocks to the node chain.
nodeAddBlocks :: [MockBlock] -> Node -> Node

0 comments on commit 19db154

Please sign in to comment.
You can’t perform that action at this time.