« 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>2023-10-14 09:18:32 -0300
commit6c5ebedbd8aeac9be0719e9104ce2c53c5540da0 (patch)
tree2bcee69c3d2b7e7b7da4fc327332dfbc58a8aded
parent7ff695f356d1e9a18d5f206e8d57bfc18c37f054 (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 cc79d40..d776ca9 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)