diff --git a/src/util.js b/src/util.js index fb1203251..5fee50185 100644 --- a/src/util.js +++ b/src/util.js @@ -7,7 +7,15 @@ * @return {*} */ export function find (list, f) { - return list.filter(f)[0] + const { length } = list + let index = 0 + let value + while (++index < length) { + value = list[index] + if (f(value, index, list)) { + return value + } + } } /**