mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-07 21:41:34 -07:00
Use find instead of listToMaybe and filter
This commit is contained in:
parent
0f48bb78a5
commit
f5c6771016
3 changed files with 7 additions and 7 deletions
|
@ -34,7 +34,7 @@ import Control.Monad.Identity
|
|||
import Control.Monad.Trans
|
||||
import Data.Char
|
||||
import Data.Functor
|
||||
import Data.List (isPrefixOf, isInfixOf, isSuffixOf, partition, sortBy, intercalate, nub)
|
||||
import Data.List (isPrefixOf, isInfixOf, isSuffixOf, partition, sortBy, intercalate, nub, find)
|
||||
import Data.Maybe
|
||||
import Data.Monoid
|
||||
import Debug.Trace
|
||||
|
@ -589,7 +589,7 @@ readConditionContents single =
|
|||
|
||||
checkTrailingOp x = fromMaybe (return ()) $ do
|
||||
(T_Literal id str) <- getTrailingUnquotedLiteral x
|
||||
trailingOp <- listToMaybe (filter (`isSuffixOf` str) binaryTestOps)
|
||||
trailingOp <- find (`isSuffixOf` str) binaryTestOps
|
||||
return $ parseProblemAtId id ErrorC 1108 $
|
||||
"You need a space before and after the " ++ trailingOp ++ " ."
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue