Skip to content

Commit 94b6e60

Browse files
authored
Apply suggestions from code review
Signed-off-by: Athan <[email protected]>
1 parent 8fa21ac commit 94b6e60

File tree

1 file changed

+7
-13
lines changed
  • lib/node_modules/@stdlib/blas/ext/base/sapx/src

1 file changed

+7
-13
lines changed

lib/node_modules/@stdlib/blas/ext/base/sapx/src/addon.c

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,20 @@
2525
#include <node_api.h>
2626

2727
/**
28-
* Adds a constant to each element in a single-precision floating-point strided array.
28+
* Receives JavaScript callback invocation data.
2929
*
30-
* ## Notes
31-
*
32-
* - When called from JavaScript, the function expects four arguments:
33-
*
34-
* - `N`: number of indexed elements
35-
* - `alpha`: scalar
36-
* - `X`: input array
37-
* - `strideX`: `X` stride length
30+
* @private
31+
* @param env environment under which the function is invoked
32+
* @param info callback data
33+
* @return Node-API value
3834
*/
3935
static napi_value addon( napi_env env, napi_callback_info info ) {
4036
STDLIB_NAPI_ARGV( env, info, argv, argc, 4 );
4137
STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
42-
STDLIB_NAPI_ARGV_DOUBLE( env, alpha, argv, 1 );
38+
STDLIB_NAPI_ARGV_FLOAT( env, alpha, argv, 1 );
4339
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 );
4440
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 2 )
45-
46-
c_sapx( N, (float)alpha, (float *)X, strideX );
47-
41+
stdlib_strided_sapx( N, alpha, X, strideX );
4842
return NULL;
4943
}
5044

0 commit comments

Comments
 (0)