We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a066e5a commit 3bd472eCopy full SHA for 3bd472e
lib/node_modules/@stdlib/streams/node/from-array/lib/main.js
@@ -57,8 +57,12 @@ function read() {
57
while ( FLG ) {
58
err = null;
59
60
- v = this._src[ this._idx ];
61
this._i += 1;
+ if ( this._i > this._src.length ) {
62
+ debug( 'Finished iteration.' );
63
+ return this.push( null );
64
+ }
65
+ v = this._src[ this._idx ];
66
debug( 'Value: %s. Idx: %d. Iter: %d.', JSON.stringify( v ), this._idx, this._i );
67
68
this._idx += this._stride;
@@ -83,10 +87,6 @@ function read() {
83
87
} else {
84
88
FLG = this.push( v );
85
89
}
86
- if ( this._i === this._src.length ) {
- debug( 'Finished iteration.' );
- return this.push( null );
- }
90
91
92
/* eslint-enable no-invalid-this */
0 commit comments