File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 653653 blockLoopsSorted . forEach ( blockLoop => {
654654 let intersectingLoopGroups = loopGroups
655655 . filter ( loopGroup => loopGroup . blockSet . isDisjointFrom ( blockLoop . blockSet ) == false ) ;
656-
656+
657657 if ( intersectingLoopGroups . length === 0 ) {
658658 let loopGroup = {
659- blockSet : blockLoop . blockSet ,
659+ blockSet : new Set ( blockLoop . blockSet ) ,
660660 subBlockLoops : [ ]
661661 }
662662 loopGroups . push ( loopGroup ) ;
663663 return ;
664664 }
665665
666666 // merge groups
667- let firstLoopGroup = intersectingLoopGroups [ 0 ] ;
668- for ( let i = 0 ; i < intersectingLoopGroups . length ; i ++ ) {
667+ let mainLoopGroup = intersectingLoopGroups [ 0 ] ;
668+ mainLoopGroup . subBlockLoops . push ( blockLoop ) ;
669+ mainLoopGroup . blockSet = mainLoopGroup . blockSet . union ( blockLoop . blockSet ) ;
670+
671+ for ( let i = 1 ; i < intersectingLoopGroups . length ; i ++ ) {
669672 let intersectingLoopGroup = intersectingLoopGroups [ i ] ;
670-
671- intersectingLoopGroup . subBlockLoops . push ( blockLoop ) ;
672- intersectingLoopGroup . blockSet = intersectingLoopGroup . blockSet . union ( blockLoop . blockSet ) ;
673673
674- if ( i > 0 )
675- removeFromArray ( loopGroups , intersectingLoopGroup ) ;
674+ mainLoopGroup . blockSet = mainLoopGroup . blockSet . union ( intersectingLoopGroup . blockSet ) ;
675+ removeFromArray ( loopGroups , intersectingLoopGroup ) ;
676676 }
677677 } ) ;
678678
You can’t perform that action at this time.
0 commit comments