From 7ac70fd261f73043396e575859531e790cc385b2 Mon Sep 17 00:00:00 2001 From: Mike Lynch Date: Sat, 12 Aug 2023 07:30:36 +1000 Subject: [PATCH] Added return from interate callback --- polytopes.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/polytopes.js b/polytopes.js index a2c616c..2a86218 100644 --- a/polytopes.js +++ b/polytopes.js @@ -262,6 +262,7 @@ function dumb_label_120cell(nodes, links) { // stupid tetrahedral labelling +// keeps getting stuck function naive_label_120cell(nodes, links, n) { @@ -283,9 +284,11 @@ function naive_label_120cell(nodes, links, n) { const pcols = [ 1, 2, 3, 4, 5 ].filter((c) => !cols.has(c)); if( pcols.length < 1 ) { console.log(`Got stuck, no options at ${n.id}`); + return false; } else { n.label = pcols[0]; console.log(`applied ${pcols[0]} to node ${n.id}`); + return true; } }); }