mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-09 14:39:24 +08:00
Remove unnecessary uses of head
This commit is contained in:
@@ -279,10 +279,10 @@ checkGrepRe = CommandCheck (Basename "grep") check where
|
||||
grepGlobFlags = ["fixed-strings", "F", "include", "exclude", "exclude-dir", "o", "only-matching"]
|
||||
|
||||
wordStartingWith c =
|
||||
head . filter ([c] `isPrefixOf`) $ candidates
|
||||
headOrDefault (c:"test") . filter ([c] `isPrefixOf`) $ candidates
|
||||
where
|
||||
candidates =
|
||||
sampleWords ++ map (\(x:r) -> toUpper x : r) sampleWords ++ [c:"test"]
|
||||
sampleWords ++ map (\(x:r) -> toUpper x : r) sampleWords
|
||||
|
||||
getSuspiciousRegexWildcard str =
|
||||
if not $ str `matches` contra
|
||||
|
Reference in New Issue
Block a user