Skip to content

Commit 63756c5

Browse files
committed
test: add tests
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 072e93e commit 63756c5

File tree

2 files changed

+1448
-111
lines changed

2 files changed

+1448
-111
lines changed

lib/node_modules/@stdlib/ndarray/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)