Change connected to be dictionary instead of array. No functional changes but should be slightly better performant.

This commit is contained in:
Filip Živković 2022-10-14 19:32:13 -07:00
parent bfe3e6a82f
commit 066fbd4913

View file

@ -68,7 +68,7 @@ window.Routes = (function () {
const bodies = new Set(allPorts.map(b => b.port)); // water features with ports const bodies = new Set(allPorts.map(b => b.port)); // water features with ports
let paths = []; // array to store path segments let paths = []; // array to store path segments
const connected = []; // store cell id of connected burgs const connected = {}; // store cell id of connected burgs
bodies.forEach(f => { bodies.forEach(f => {
const ports = allPorts.filter(b => b.port === f); // all ports on the same feature const ports = allPorts.filter(b => b.port === f); // all ports on the same feature