mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-06 13:01:39 -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
|
@ -457,8 +457,8 @@ checkEchoSed = ForShell [Bash, Ksh] f
|
|||
-- This should have used backreferences, but TDFA doesn't support them
|
||||
sedRe = mkRegex "^s(.)([^\n]*)g?$"
|
||||
isSimpleSed s = fromMaybe False $ do
|
||||
[first,rest] <- matchRegex sedRe s
|
||||
let delimiters = filter (== head first) rest
|
||||
[h:_,rest] <- matchRegex sedRe s
|
||||
let delimiters = filter (== h) rest
|
||||
guard $ length delimiters == 2
|
||||
return True
|
||||
checkIn id s =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue