diff --git a/src/user/search.js b/src/user/search.js index a87d75be35..90a17cb521 100644 --- a/src/user/search.js +++ b/src/user/search.js @@ -17,10 +17,8 @@ module.exports = function(User) { query = query.toLowerCase(); - var usernames = Object.keys(usernamesHash), - uids = []; - - uids = usernames.filter(function(username) { + var usernames = Object.keys(usernamesHash); + var uids = usernames.filter(function(username) { return username.toLowerCase().indexOf(query) === 0; }) .slice(0, 10)