Skip to content

Commit d18a524

Browse files
committed
fix: correct comments and improve variable naming in mapMultiple function
1 parent 40fce3d commit d18a524

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/function/matrix/map.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,8 @@ export const createMap = /* #__PURE__ */ factory(name, dependencies, ({ typed })
162162

163163
function mapMultiple (Collections, callback) {
164164
// collections can be matrices or arrays
165-
// callback must be a function of the form (collcetions, [index])
165+
// callback must be a function of the form (collections, [index])
166166
const firstCollection = Collections[0]
167-
const firstCollectionIsMatrix = Boolean(firstCollection.isMatrix)
168167
const Arrays = Collections.map((collection) =>
169168
collection.isMatrix ? collection.valueOf() : collection
170169
)
@@ -178,11 +177,11 @@ export const createMap = /* #__PURE__ */ factory(name, dependencies, ({ typed })
178177
const callbackUsesIndex = callback.length > 1
179178
const index = callbackUsesIndex ? [] : null
180179
const resultsArray = iterate(Arrays, 0)
181-
if (firstCollectionIsMatrix) {
182-
const returnMatrix = firstCollection.create()
183-
returnMatrix._data = resultsArray
184-
returnMatrix._size = finalSize
185-
return returnMatrix
180+
if (firstCollection.isMatrix) {
181+
const resultsMatrix = firstCollection.create()
182+
resultsMatrix._data = resultsArray
183+
resultsMatrix._size = finalSize
184+
return resultsMatrix
186185
} else {
187186
return resultsArray
188187
}

0 commit comments

Comments
 (0)