Skip to content

Commit 2f38ba6

Browse files
committed
refactor: avoid unnecessary offset calculation
--- 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: na - 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 91e532c commit 2f38ba6

File tree

1 file changed

+1
-2
lines changed
  • lib/node_modules/@stdlib/ndarray/zeros/lib

1 file changed

+1
-2
lines changed

lib/node_modules/@stdlib/ndarray/zeros/lib/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ var isPlainObject = require( '@stdlib/assert/is-plain-object' );
2525
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
2626
var isArrayLike = require( '@stdlib/assert/is-array-like' );
2727
var shape2strides = require( '@stdlib/ndarray/base/shape2strides' );
28-
var strides2offset = require( '@stdlib/ndarray/base/strides2offset' );
2928
var buffer = require( '@stdlib/ndarray/base/buffer' );
3029
var numel = require( '@stdlib/ndarray/base/numel' );
3130
var ndarray = require( '@stdlib/ndarray/ctor' );
@@ -132,7 +131,7 @@ function zeros( shape ) {
132131
if ( buf === null ) {
133132
throw new TypeError( format( 'invalid option. `%s` option must be a recognized data type. Option: `%s`.', 'dtype', dtype ) );
134133
}
135-
return new ndarray( dtype, buf, sh, st, strides2offset( sh, st ), order, opts ); // eslint-disable-line max-len
134+
return new ndarray( dtype, buf, sh, st, 0, order, opts );
136135
}
137136

138137

0 commit comments

Comments
 (0)