Apparently Object.keys is kinda slow

This commit is contained in:
David Baker 2015-06-24 14:01:59 +01:00
parent 52f6fa89a1
commit a54a7f80aa
1 changed files with 3 additions and 2 deletions

View File

@ -50,9 +50,10 @@ module.exports = {
roomMembers() { roomMembers() {
var cli = MatrixClientPeg.get(); var cli = MatrixClientPeg.get();
var all_members = cli.getRoom(this.props.roomId).currentState.members; var all_members = cli.getRoom(this.props.roomId).currentState.members;
var all_user_ids = Object.keys(all_members);
var to_display = {}; var to_display = {};
for (var i = 0; i < Object.keys(all_members).length; ++i) { for (var i = 0; i < all_user_ids.length; ++i) {
var user_id = Object.keys(all_members)[i]; var user_id = all_user_ids[i];
var m = all_members[user_id]; var m = all_members[user_id];
if (m.membership == 'join' || m.membership == 'invite') { if (m.membership == 'join' || m.membership == 'invite') {