Altinn / app-frontend-react

Altinn application React frontend
BSD 3-Clause "New" or "Revised" License
18 stars 31 forks source link

Making node-lookups faster #2701

Closed olemartinorg closed 2 weeks ago

olemartinorg commented 2 weeks ago

Description

This should make node-lookups faster. Previously, every page would be iterated to look for a node object, but as node-ids can no longer be duplicated/re-used across pages, we can just create a Map to look them up directly. This also has the advantage of running getBaseComponentId() 0 or 1 times, instead of once-per-page for pages that don't have the node in them.

I also removed some unused code in node traversal.

Related Issue(s)

Verification/QA

sonarcloud[bot] commented 2 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
75.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud