From 2465201b0b4e5190feb4e47c732f2b161323aae3 Mon Sep 17 00:00:00 2001 From: juan Date: Fri, 18 Jul 2025 10:57:50 -0400 Subject: [PATCH] O(1) optimization --- lib/collapsableEmailsWeb.dart | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/collapsableEmailsWeb.dart b/lib/collapsableEmailsWeb.dart index 3300e5e..b758783 100644 --- a/lib/collapsableEmailsWeb.dart +++ b/lib/collapsableEmailsWeb.dart @@ -176,22 +176,9 @@ class _CollapsableEmailsState extends State { AugmentTree temp = AugmentTree(); temp.data = node.textContent; temp.ogTag = node.tag; - if (node.tag == 'h1') { - // make this O(1) + //why did i do this??? + if ( hirarchyDict.containsKey(node.tag)) { _add2Tree(zoomTreeRoot, node); - } else if (node.tag == 'h2') { - // i dont add any since i dont have it, maybe the function makes sense - _add2Tree(zoomTreeRoot, node); // fix this - } else if (node.tag == 'h3') { - _add2Tree(zoomTreeRoot, node); - } else if (node.tag == 'h4') { - _add2Tree(zoomTreeRoot, node); // change to temp - } else if (node.tag == 'h5') { - _add2Tree(zoomTreeRoot, node); - } else if (node.tag == 'h6') { - _add2Tree(zoomTreeRoot, node); // fix this - } else if (node.tag == 'p' || node.tag == 'ul' || node.tag == 'li') { - _add2Tree(zoomTreeRoot, node); // fix this } } }