« get me outta code hell

content: listArtTagNetwork: minor optimization - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-10-14 09:18:32 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-02-25 20:03:27 -0400
commitaaa82b34da687c1c652c4bfb48be7130990e05f7 (patch)
tree8bc41c9a885ecd9026f37802ead4efbf959c4d6c
parentfdeb58f2515542c0528ddeaabfbab1b2a895d3d9 (diff)
content: listArtTagNetwork: minor optimization
-rw-r--r--src/content/dependencies/listArtTagNetwork.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/content/dependencies/listArtTagNetwork.js b/src/content/dependencies/listArtTagNetwork.js
index d0a5f058..8ff0a609 100644
--- a/src/content/dependencies/listArtTagNetwork.js
+++ b/src/content/dependencies/listArtTagNetwork.js
@@ -43,9 +43,9 @@ export default {
           - (descendantNodesB ? 1 : 0));
 
       const recursiveGetRootAncestor = ancestorArtTag =>
-        (rootArtTags.includes(ancestorArtTag)
-          ? ancestorArtTag
-          : recursiveGetRootAncestor(ancestorArtTag.directAncestorArtTags[0]));
+        (ancestorArtTag.directAncestorArtTags.length === 1
+          ? recursiveGetRootAncestor(ancestorArtTag.directAncestorArtTags[0])
+          : ancestorArtTag);
 
       const ancestorRootArtTags =
         (asRoot && !empty(artTag.directAncestorArtTags)