mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-13 16:43:20 -07:00
Remove unnecessary uses of head
This commit is contained in:
parent
c95914f9b3
commit
6d06103cab
5 changed files with 14 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue