Skip to content

Commit

Permalink
Can't use the usual reverse-order for splicing in depths of BFS layou…
Browse files Browse the repository at this point in the history
…t on account of saving the indices #1992
  • Loading branch information
maxkfranz committed Oct 23, 2017
1 parent 66ca5a9 commit 391ce4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/extensions/layout/breadthfirst.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,12 @@ BreadthFirstLayout.prototype.run = function(){
for( let i = 0; i < depths.length; i++ ){
let eles = depths[ i ];

for( let j = eles.length - 1; j >= 0; j-- ){
for( let j = 0; j < eles.length; j++ ){
let ele = eles[ j ];

if( ele == null ){
eles.splice( j, 1 );
j--;
continue;
}

Expand Down

0 comments on commit 391ce4e

Please sign in to comment.