From d1052887c8a429d7e11aa231572c8749fafdfc44 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sat, 14 Jan 2023 03:57:43 -0500 Subject: [PATCH] clarify recursive function in comment too --- packages/fakeyou.com/src/AppWrapper.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/fakeyou.com/src/AppWrapper.tsx b/packages/fakeyou.com/src/AppWrapper.tsx index 89393721a2..a13bc1d3f3 100644 --- a/packages/fakeyou.com/src/AppWrapper.tsx +++ b/packages/fakeyou.com/src/AppWrapper.tsx @@ -177,11 +177,14 @@ export function AppWrapper(props: Props) { ) } +/// NB: This was the really expensive cubic time++ aglorithm to recursively calculate nested category assignments. +/// This has since been ported to the server and will no longer be computed here. We're preserving this for posterity. +/// /// function findAllAncestorTokens(categoryToken: string, allCategoriesByTokenMap: Map): Set { /// const ancestorTokens = recursiveFindAllAncestorTokens(categoryToken, allCategoriesByTokenMap); /// return new Set(ancestorTokens); /// } - +/// /// function recursiveFindAllAncestorTokens(categoryToken: string, allCategoriesByTokenMap: Map): string[] { /// let category = allCategoriesByTokenMap.get(categoryToken) /// if (category === undefined) {