Skip to content

Commit 3904c63

Browse files
committed
use more efficient key-flattening in filterBy
1 parent 35087ba commit 3904c63

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/filters/array-filters.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ export function filterBy (arr, search, delimiter) {
4646
// because why not
4747
var n = delimiter === 'in' ? 3 : 2
4848
// extract and flatten keys
49-
var keys = toArray(arguments, n).reduce(function (prev, cur) {
50-
return prev.concat(cur)
51-
}, [])
49+
var keys = Array.prototype.concat.apply([], toArray(arguments, n))
5250
var res = []
5351
var item, key, val, j
5452
for (var i = 0, l = arr.length; i < l; i++) {

0 commit comments

Comments
 (0)