Manually fuse elem and map in isParentOf

This commit is contained in:
Joseph C. Sible 2023-12-31 02:27:52 -05:00
parent add49cda17
commit 71c0fcb737
1 changed files with 3 additions and 1 deletions

View File

@ -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)