Skip to content

Commit 46bd31e

Browse files
committed
Auto-generated commit
1 parent d22cdc6 commit 46bd31e

File tree

3 files changed

+1449
-111
lines changed

3 files changed

+1449
-111
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ A total of 15 issues were closed in this release:
391391

392392
<details>
393393

394+
- [`63756c5`](https://github.com/stdlib-js/stdlib/commit/63756c5110a952dc6f7d874badb99f125312902a) - **test:** add tests _(by Athan Reines)_
394395
- [`01544ae`](https://github.com/stdlib-js/stdlib/commit/01544aef20deb6e2b8c6826462cd29916ce3e45b) - **test:** add tests _(by Athan Reines)_
395396
- [`b2cefbe`](https://github.com/stdlib-js/stdlib/commit/b2cefbe2b2192cb705b85c43ffac2f57ca782c42) - **feat:** add custom `valueOf` method _(by Athan Reines)_
396397
- [`848f226`](https://github.com/stdlib-js/stdlib/commit/848f226d45aad2d627453c8306ae192c75338ac3) - **feat:** add `factory` method _(by Athan Reines)_

vector/ctor/lib/main.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -309,14 +309,12 @@ function vectorWithDType( arg, dtype, options ) {
309309
}
310310
// Case: vector( Iterable )
311311
if ( isIterableLike( arg ) ) {
312-
if ( isGenericDataType( dtype ) ) {
313-
buf = arg[ ITERATOR_SYMBOL ]();
314-
buf = iterator2array( buf );
315-
} else if ( isBinaryDataType( dtype ) ) {
316-
buf = arg[ ITERATOR_SYMBOL ]();
317-
buf = array2buffer( iterator2array( buf ) ); // note: the temporary array is necessary as we cannot allocate a `Buffer` in advance due to the iterator's indeterminate length
318-
} else {
319-
buf = typedarray( arg, dtype );
312+
buf = arg[ ITERATOR_SYMBOL ]();
313+
buf = iterator2array( buf );
314+
if ( isBinaryDataType( dtype ) ) {
315+
buf = array2buffer( buf );
316+
} else if ( !isGenericDataType( dtype ) ) {
317+
buf = typedarray( buf, dtype );
320318
}
321319
return new ndarray( dtype, buf, [ buf.length ], [ 1 ], 0, resolveOrder( opts ), opts );
322320
}

0 commit comments

Comments
 (0)