Fuse map into any

This commit is contained in:
Joseph C. Sible 2020-12-28 18:00:14 -05:00
parent e7820479f0
commit 34939ca0b7
1 changed files with 2 additions and 2 deletions

View File

@ -2481,7 +2481,7 @@ checkCharRangeGlob p t@(T_Glob id str) |
where where
isCharClass str = "[" `isPrefixOf` str && "]" `isSuffixOf` str isCharClass str = "[" `isPrefixOf` str && "]" `isSuffixOf` str
contents = dropNegation . drop 1 . take (length str - 1) $ str contents = dropNegation . drop 1 . take (length str - 1) $ str
hasDupes = any (>1) . map length . group . sort . filter (/= '-') $ contents hasDupes = any ((>1) . length) . group . sort . filter (/= '-') $ contents
dropNegation s = dropNegation s =
case s of case s of
'!':rest -> rest '!':rest -> rest
@ -3404,7 +3404,7 @@ checkPipeToNowhere params t =
commandSpecificException name cmd = commandSpecificException name cmd =
case name of case name of
"du" -> any (`elem` ["exclude-from", "files0-from"]) $ map snd $ getAllFlags cmd "du" -> any ((`elem` ["exclude-from", "files0-from"]) . snd) $ getAllFlags cmd
_ -> False _ -> False
warnAboutDupes (n, list@(_:_:_)) = warnAboutDupes (n, list@(_:_:_)) =