summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph C. Sible <josephcsible@users.noreply.github.com>2023-12-31 02:27:52 -0500
committerJoseph C. Sible <josephcsible@users.noreply.github.com>2023-12-31 02:27:52 -0500
commit71c0fcb737e94d7f2aa65e0540ddc2554f63bdd7 (patch)
tree2db2c64b2cf099a05e4e96a0c9aae01914348800
parentadd49cda171058b921fb57a2b658511159858a1f (diff)
Manually fuse elem and map in isParentOf
-rw-r--r--src/ShellCheck/AnalyzerLib.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ShellCheck/AnalyzerLib.hs b/src/ShellCheck/AnalyzerLib.hs
index 21123d4..944b12d 100644
--- a/src/ShellCheck/AnalyzerLib.hs
+++ b/src/ShellCheck/AnalyzerLib.hs
@@ -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)