reverse and keep smallest

remotes/origin/dev-gas-wcet
agroce 5 years ago
parent 21629b8d0b
commit ee56431f76
  1. 3
      lib/Echidna/Campaign.hs

@ -178,7 +178,8 @@ updateGasInfo [] _ gi = gi
updateGasInfo ((t@(Tx (SolCall((f, _))) _ _ _ _ _ _), (_, used')):ts) tseq gi =
let mused = Data.Map.lookup f gi
in case mused of Nothing -> updateGasInfo ts (t:tseq) (insert f (used', t:tseq) gi)
Just (used, _) | used' > used -> updateGasInfo ts (t:tseq) (insert f (used', t:tseq) gi)
Just (used, _) | used' > used -> updateGasInfo ts (t:tseq) (insert f (used', reverse (t:tseq)) gi)
Just (used, otseq) | (used' == used) && ((length otseq) > (length (t:tseq))) -> updateGasInfo ts (t:tseq) (insert f (used', reverse (t:tseq)) gi)
_ -> updateGasInfo ts (t:tseq) gi
updateGasInfo ((t, _):ts) tseq gi = updateGasInfo ts (t:tseq) gi

Loading…
Cancel
Save