From aaa82b34da687c1c652c4bfb48be7130990e05f7 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 14 Oct 2023 09:18:32 -0300 Subject: content: listArtTagNetwork: minor optimization --- src/content/dependencies/listArtTagNetwork.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/content') 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) -- cgit 1.3.0-6-gf8a5