Skip to content

Commit 780dcba

Browse files
🎨 style(blossom): Reduce scope of variables, use for..of loops.
1 parent 58a2630 commit 780dcba

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/core/blossom/blossom.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,11 @@ export default function blossom(CHECK_OPTIMUM, CHECK_DELTA) {
218218
const scanBlossom = function (v, w) {
219219
console.debug('DEBUG: scanBlossom(' + v + ',' + w + ')');
220220
// Trace back from v and w, placing breadcrumbs as we go.
221-
let b;
222-
let i;
223221
const path = [];
224222
let base = -1;
225223
while (v !== -1 || w !== -1) {
226224
// Look for a breadcrumb in v's blossom or put a new breadcrumb.
227-
b = inblossom[v];
225+
let b = inblossom[v];
228226
if (label[b] & 4) {
229227
base = blossombase[b];
230228
break;
@@ -256,11 +254,7 @@ export default function blossom(CHECK_OPTIMUM, CHECK_DELTA) {
256254
}
257255

258256
// Remove breadcrumbs.
259-
i = path.length;
260-
while (i--) {
261-
b = path[i];
262-
label[b] = 1;
263-
}
257+
for (const b of path) label[b] = 1;
264258

265259
// Return base vertex, if we found one.
266260
return base;

0 commit comments

Comments
 (0)