Skip to content

Commit 7f166d4

Browse files
committed
Call methods directly on data buffer
1 parent 197550b commit 7f166d4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/node_modules/@stdlib/ndarray/ctor/lib/get.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ function get() {
6060
ind = getIndex( arguments[ i ], this._shape[ i ]-1, this._submode[ i%M ] ); // eslint-disable-line max-len
6161
idx += this._strides[ i ] * ind;
6262
}
63-
if ( this._getter ) {
64-
return this._getter.call( this._buffer, idx );
63+
if ( this._accessors ) {
64+
return this._buffer.get( idx );
6565
}
6666
return this._buffer[ idx ];
6767
}

lib/node_modules/@stdlib/ndarray/ctor/lib/set.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ function set() {
6161
ind = getIndex( arguments[ i ], this._shape[ i ]-1, this._submode[ i%M ] ); // eslint-disable-line max-len
6262
idx += this._strides[ i ] * ind;
6363
}
64-
if ( this._setter ) {
65-
this._setter.call( this._buffer, arguments[ i ], idx );
64+
if ( this._accessors ) {
65+
this._buffer.set( arguments[ i ], idx );
6666
} else {
6767
this._buffer[ idx ] = arguments[ i ];
6868
}

0 commit comments

Comments
 (0)