Skip to content

Commit 80e9e9a

Browse files
committed
fix: update accessor resolution
1 parent 949ec7d commit 80e9e9a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,8 +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 accessors = require( '@stdlib/array/base/accessors' );
36-
var adtype = require( '@stdlib/array/dtype' );
35+
var resolveGetter = require( '@stdlib/array/base/resolve-getter' );
36+
var resolveSetter = require( '@stdlib/array/base/resolve-setter' );
3737
var ARRAY_DEFAULTS = require( '@stdlib/array/defaults' );
3838
var format = require( '@stdlib/string/format' );
3939
var ArrayBuffer = require( '@stdlib/array/buffer' );
@@ -257,9 +257,9 @@ function factory( options ) {
257257
out.set( arr );
258258
return out;
259259
}
260-
// 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...
261-
get = accessors( adtype( arr ) ).accessors[ 0 ];
262-
set = accessors( dtype ).accessors[ 1 ];
260+
// Resolve element accessors 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...
261+
get = resolveGetter( arr );
262+
set = resolveSetter( out );
263263
for ( i = 0; i < len; i++ ) {
264264
set( out, i, get( arr, i ) );
265265
}

0 commit comments

Comments
 (0)