Skip to content

Commit 7d3d283

Browse files
committed
Refactor based on updates to ndarraylike2object
1 parent 362e56f commit 7d3d283

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/node_modules/@stdlib/utils/map2/lib/ndarray.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var MODE = 'throw';
4343
* @param {IntegerArray} x.strides - stride lengths
4444
* @param {NonNegativeInteger} x.offset - index offset
4545
* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)
46-
* @param {Function} x.getter - callback for accessing `x` data buffer elements
46+
* @param {Array<Function>} x.accessors - accessors for accessing data buffer elements
4747
* @param {Object} y - object containing meta data for the second input ndarray
4848
* @param {string} y.ref - reference to original input ndarray-like object
4949
* @param {string} y.dtype - data type
@@ -53,7 +53,7 @@ var MODE = 'throw';
5353
* @param {IntegerArray} y.strides - stride lengths
5454
* @param {NonNegativeInteger} y.offset - index offset
5555
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
56-
* @param {Function} y.getter - callback for accessing `y` data buffer elements
56+
* @param {Array<Function>} y.accessors - accessors for accessing data buffer elements
5757
* @param {Object} z - object containing output ndarray meta data
5858
* @param {string} z.dtype - data type
5959
* @param {Collection} z.data - data buffer
@@ -62,7 +62,7 @@ var MODE = 'throw';
6262
* @param {IntegerArray} z.strides - stride lengths
6363
* @param {NonNegativeInteger} z.offset - index offset
6464
* @param {string} z.order - specifies whether `z` is row-major (C-style) or column-major (Fortran-style)
65-
* @param {Function} z.setter - callback for setting `z` data buffer elements
65+
* @param {Array<Function>} z.accessors - accessors for accessing data buffer elements
6666
* @param {Function} fcn - function to apply
6767
* @param {*} thisArg - function execution context
6868
* @returns {void}
@@ -112,7 +112,7 @@ var MODE = 'throw';
112112
* 'strides': sx,
113113
* 'offset': ox,
114114
* 'order': 'row-major',
115-
* 'getter': getter
115+
* 'accessors': [ getter, setter ]
116116
* };
117117
* x.ref = x;
118118
*
@@ -125,7 +125,7 @@ var MODE = 'throw';
125125
* 'strides': sy,
126126
* 'offset': ox,
127127
* 'order': 'row-major',
128-
* 'getter': getter
128+
* 'accessors': [ getter, setter ]
129129
* };
130130
* y.ref = y;
131131
*
@@ -138,7 +138,7 @@ var MODE = 'throw';
138138
* 'strides': sz,
139139
* 'offset': oz,
140140
* 'order': 'row-major',
141-
* 'setter': setter
141+
* 'accessors': [ getter, setter ]
142142
* };
143143
*
144144
* // Apply the function:
@@ -208,9 +208,9 @@ function map2( x, y, z, fcn, thisArg ) {
208208
ordz = z.order;
209209

210210
// Cache accessors:
211-
xget = x.getter;
212-
yget = y.getter;
213-
zset = z.setter;
211+
xget = x.accessors[ 0 ];
212+
yget = y.accessors[ 0 ];
213+
zset = z.accessors[ 1 ];
214214

215215
// Cache references to the original input arrays:
216216
xref = x.ref;

0 commit comments

Comments
 (0)