Skip to content

Commit 6ea44e7

Browse files
committed
Inline accessor logic
1 parent 6086e6b commit 6ea44e7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/node_modules/@stdlib/array/pool/lib/factory.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only
3232
var ctors = require( '@stdlib/array/typed-ctors' );
3333
var reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );
3434
var reinterpret128 = require( '@stdlib/strided/base/reinterpret-complex128' );
35-
var arraylike2object = require( '@stdlib/array/base/arraylike2object' );
35+
var accessors = require( '@stdlib/array/base/accessors' );
36+
var adtype = require( '@stdlib/array/dtype' );
3637
var format = require( '@stdlib/string/format' );
3738
var copy = require( '@stdlib/utils/copy' );
3839
var ArrayBuffer = require( '@stdlib/array/buffer' );
@@ -255,9 +256,9 @@ function factory( options ) {
255256
out.set( arr );
256257
return out;
257258
}
258-
// Wrap the arrays in order to account for the possibility that `arr` is a complex number array. As we don't prohibit other "unsafe" casts (e.g., providing a `Float64Array` and specifying a `dtype` of `uint8`), we don't prohibit providing a complex number array and specifying a real `dtype`. The results will probably be unexpected/gibberish, but I am not sure we should be overly pedantic in ensuring user's don't do ill-advised things...
259-
get = arraylike2object( arr ).getter;
260-
set = arraylike2object( out ).setter;
259+
// Wrap the arrays in order to account for the possibility that `arr` is a complex number array. As we don't prohibit other "unsafe" casts (e.g., providing a `Float64Array` and specifying a `dtype` of `uint8`), we don't prohibit providing a complex number array and specifying a real `dtype`. The results will probably be unexpected/gibberish, but I am not sure we should be overly pedantic in ensuring users don't do ill-advised things...
260+
get = accessors( adtype( arr ) ).accessors[ 0 ];
261+
set = accessors( dtype ).accessors[ 1 ];
261262
for ( i = 0; i < len; i++ ) {
262263
set( out, i, get( arr, i ) );
263264
}

0 commit comments

Comments
 (0)