mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 22:21:04 +08:00
Manually fuse elem and map in isParentOf
This commit is contained in:
@@ -430,7 +430,9 @@ getPathM t = do
|
|||||||
return $ getPath (parentMap params) t
|
return $ getPath (parentMap params) t
|
||||||
|
|
||||||
isParentOf tree parent child =
|
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)
|
parents params = getPath (parentMap params)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user