Skip to content

Commit

Permalink
Manually fuse elem and map in isParentOf
Browse files Browse the repository at this point in the history
  • Loading branch information
josephcsible committed Dec 31, 2023
1 parent add49cd commit 71c0fcb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ShellCheck/AnalyzerLib.hs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,9 @@ getPathM t = do
return $ getPath (parentMap params) t

isParentOf tree parent child =
elem (getId parent) . NE.map getId $ getPath tree child
any (\t -> parentId == getId t) (getPath tree child)
where
parentId = getId parent

parents params = getPath (parentMap params)

Expand Down

0 comments on commit 71c0fcb

Please sign in to comment.