Skip to content

Commit 2588ea0

Browse files
committed
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into develop
2 parents 0d137d9 + 640d25b commit 2588ea0

File tree

1 file changed

+11
-7
lines changed
  • lib/node_modules/@stdlib/utils/compact-adjacency-matrix/lib

1 file changed

+11
-7
lines changed

lib/node_modules/@stdlib/utils/compact-adjacency-matrix/lib/main.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -632,18 +632,22 @@ setReadOnly( CompactAdjacencyMatrix.prototype, 'toposort', function toposort() {
632632
if ( visited[ j ] ) {
633633
continue;
634634
}
635-
// Remove edge (if it exists):
635+
// Determine if edge exists:
636636
idx = this._loc( i, j, idx );
637637
w = buf[ idx[0] ];
638638
if ( isSet( w, idx[1] ) ) {
639+
// Remove the edge:
639640
buf[ idx[0] ] = clearBit( w, idx[1] );
641+
642+
// Decrement the number of incoming edges for the current vertex:
640643
degs[ j ] -= 1;
641-
}
642-
// Check whether the current vertex has any incoming edges:
643-
if ( degs[ j ] === 0 ) {
644-
// We have a new vertex which we can push onto the stack:
645-
s.push( j );
646-
visited[ j ] = 1;
644+
645+
// Check whether the current vertex has any incoming edges:
646+
if ( degs[ j ] === 0 ) {
647+
// We have a new vertex which we can push onto the stack:
648+
s.push( j );
649+
visited[ j ] = 1;
650+
}
647651
}
648652
}
649653
}

0 commit comments

Comments
 (0)