Skip to content

Commit c534356

Browse files
🎨 style: Use for..of loops and continue.
1 parent 67c5dd8 commit c534356

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

src/core/blossom/blossom.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -555,16 +555,15 @@ export default function blossom(CHECK_OPTIMUM, CHECK_DELTA) {
555555
}
556556

557557
for (const v of blossomLeaves(nvertex, blossomchilds, bv)) {
558-
if (label[v] !== 0) {
559-
// If the sub-blossom contains a reachable vertex, assign
560-
// label T to the sub-blossom.
561-
assert(label[v] === 2);
562-
assert(inblossom[v] === bv);
563-
label[v] = 0;
564-
label[endpoint[mate[blossombase[bv]]]] = 0;
565-
assignLabel(v, 2, labelend[v]);
566-
break;
567-
}
558+
if (label[v] === 0) continue;
559+
// If the sub-blossom contains a reachable vertex, assign
560+
// label T to the sub-blossom.
561+
assert(label[v] === 2);
562+
assert(inblossom[v] === bv);
563+
label[v] = 0;
564+
label[endpoint[mate[blossombase[bv]]]] = 0;
565+
assignLabel(v, 2, labelend[v]);
566+
break;
568567
}
569568

570569
j += jstep;

src/core/blossom/checkDelta3.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ const checkDelta3 = ({
2121
for (let b = 0; b < 2 * nvertex; ++b) {
2222
if (blossomparent[b] === -1 && label[b] === 1) {
2323
for (const v of blossomLeaves(nvertex, blossomchilds, b)) {
24-
for (let x = 0; x < neighbend[v].length; ++x) {
25-
const p = neighbend[v][x];
24+
for (const p of neighbend[v]) {
2625
const k = Math.floor(p / 2);
2726
const w = endpoint[p];
2827
if (inblossom[w] !== b && label[inblossom[w]] === 1) {

0 commit comments

Comments
 (0)