From a54a7f80aac7abdc6c1dfe962c4f4bac114e9cb9 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 24 Jun 2015 14:01:59 +0100 Subject: [PATCH] Apparently Object.keys is kinda slow --- src/controllers/organisms/MemberList.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controllers/organisms/MemberList.js b/src/controllers/organisms/MemberList.js index f3728547..5bfe61ca 100644 --- a/src/controllers/organisms/MemberList.js +++ b/src/controllers/organisms/MemberList.js @@ -50,9 +50,10 @@ module.exports = { roomMembers() { var cli = MatrixClientPeg.get(); var all_members = cli.getRoom(this.props.roomId).currentState.members; + var all_user_ids = Object.keys(all_members); var to_display = {}; - for (var i = 0; i < Object.keys(all_members).length; ++i) { - var user_id = Object.keys(all_members)[i]; + for (var i = 0; i < all_user_ids.length; ++i) { + var user_id = all_user_ids[i]; var m = all_members[user_id]; if (m.membership == 'join' || m.membership == 'invite') {