Skip to content

Commit 7f54590

Browse files
committed
refactor: use generalized utility
--- 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 45ee3d6 commit 7f54590

File tree

2 files changed

+2
-48
lines changed

2 files changed

+2
-48
lines changed

lib/node_modules/@stdlib/ndarray/base/unary-tiling-block-size/lib/defaults.js

Lines changed: 0 additions & 34 deletions
This file was deleted.

lib/node_modules/@stdlib/ndarray/base/unary-tiling-block-size/lib/main.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020

2121
// MODULES //
2222

23-
var bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' );
24-
var defaults = require( './defaults.js' );
23+
var blockSize = require( '@stdlib/ndarray/base/tiling-block-size' );
2524

2625

2726
// MAIN //
@@ -38,18 +37,7 @@ var defaults = require( './defaults.js' );
3837
* // returns <number>
3938
*/
4039
function unaryBlockSize( dtypeX, dtypeY ) {
41-
var nbx;
42-
var nby;
43-
44-
nbx = bytesPerElement( dtypeX );
45-
nby = bytesPerElement( dtypeY );
46-
if ( nbx === null || nby === null ) { // e.g., "generic" arrays
47-
return defaults.BLOCK_SIZE_IN_ELEMENTS;
48-
}
49-
if ( nbx > nby ) {
50-
return ( defaults.BLOCK_SIZE_IN_BYTES/nbx )|0; // asm type annotation
51-
}
52-
return ( defaults.BLOCK_SIZE_IN_BYTES/nby )|0; // asm type annotation
40+
return blockSize( [ dtypeX, dtypeY ] );
5341
}
5442

5543

0 commit comments

Comments
 (0)