Skip to content

Commit

Permalink
Use minimumBy, as suggested by the linter.
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ committed Apr 26, 2024
1 parent 7dc8742 commit 240c0b7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/src/Ogmios/Data/Ledger/PredicateFailure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ import Cardano.Ledger.Plutus.Language
import Cardano.Ledger.TxIn
( TxIn (..)
)
import Data.Foldable
( minimumBy
)
import Ogmios.Data.Ledger
( ContextErrorInAnyEra (..)
, DiscriminatedEntities (..)
Expand All @@ -108,8 +111,6 @@ import PlutusLedgerApi.Common
( ExBudget (..)
)

import qualified Data.List.NonEmpty as NE

data MultiEraPredicateFailure crypto
---------------------------------------------------------------------------
-- Rule → UTXOW
Expand Down Expand Up @@ -529,7 +530,7 @@ data MultiEraPredicateFailure crypto
-- which error to return from the list when presented with many.
pickPredicateFailure :: NonEmpty (MultiEraPredicateFailure crypto) -> MultiEraPredicateFailure crypto
pickPredicateFailure =
head . NE.sortBy (comparing predicateFailurePriority)
minimumBy (comparing predicateFailurePriority)

-- | Return a priority index for ledger rules errors. Smaller means that errors
-- should be considered first.
Expand Down

0 comments on commit 240c0b7

Please sign in to comment.