From 749e1e44b9ca977b8c989417c8156f848180e4ff Mon Sep 17 00:00:00 2001 From: Nicolas Gotchac Date: Wed, 19 Oct 2016 13:15:01 +0200 Subject: [PATCH] Use Array.prototype.some instead of `filter` then `length` --- js/src/views/Accounts/List/list.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/src/views/Accounts/List/list.js b/js/src/views/Accounts/List/list.js index 9cb2c547d..bcdf7b072 100644 --- a/js/src/views/Accounts/List/list.js +++ b/js/src/views/Accounts/List/list.js @@ -133,8 +133,7 @@ export default class List extends Component { return searchValues .map(searchValue => { return values - .filter(value => value.indexOf(searchValue) >= 0) - .length > 0; + .some(value => value.indexOf(searchValue) >= 0); }) // `current && truth, true` => use tokens as AND // `current || truth, false` => use tokens as OR