@@ -269,9 +269,6 @@ export default function blossom(CHECK_OPTIMUM, CHECK_DELTA) {
269
269
// variable to zero; relabel its T-vertices to S and add them to the queue.
270
270
const addBlossom = function ( base , k ) {
271
271
let i ;
272
- let j ;
273
- let nblist ;
274
- let nblists ;
275
272
let v = edges [ k ] [ 0 ] ;
276
273
let w = edges [ k ] [ 1 ] ;
277
274
const bb = inblossom [ base ] ;
@@ -359,33 +356,23 @@ export default function blossom(CHECK_OPTIMUM, CHECK_DELTA) {
359
356
360
357
const length_ = path . length ;
361
358
for ( let z = 0 ; z < length_ ; ++ z ) {
359
+ let nblists ;
362
360
bv = path [ z ] ;
363
-
364
361
if ( blossombestedges [ bv ] === null ) {
365
362
// This subblossom does not have a list of least-slack edges;
366
363
// get the information from the vertices.
367
364
nblists = [ ] ;
368
365
for ( const v of blossomLeaves ( nvertex , blossomchilds , bv ) ) {
369
- j = neighbend [ v ] . length ;
370
- const temporary_ = new Array ( j ) ;
371
- while ( j -- ) {
372
- const p = neighbend [ v ] [ j ] ;
373
- temporary_ [ j ] = Math . floor ( p / 2 ) ;
374
- }
375
-
366
+ const temporary_ = neighbend [ v ] . map ( ( p ) => Math . floor ( p / 2 ) ) ;
376
367
nblists . push ( temporary_ ) ;
377
368
}
378
369
} else {
379
370
// Walk this subblossom's least-slack edges.
380
371
nblists = [ blossombestedges [ bv ] ] ;
381
372
}
382
373
383
- for ( let x = 0 , m = nblists . length ; x < m ; ++ x ) {
384
- nblist = nblists [ x ] ;
385
-
386
- for ( let y = 0 , n = nblist . length ; y < n ; ++ y ) {
387
- const k = nblist [ y ] ;
388
-
374
+ for ( const nblist of nblists ) {
375
+ for ( const k of nblist ) {
389
376
let i = edges [ k ] [ 0 ] ;
390
377
let j = edges [ k ] [ 1 ] ;
391
378
0 commit comments