From 1e09399dd6e8469f6a15382120dae5b617ca7dc2 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 30 Jan 2020 21:01:55 +0000 Subject: [PATCH] delint and collapse two consecutive filter operations Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/dialogs/InviteDialog.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/views/dialogs/InviteDialog.js b/src/components/views/dialogs/InviteDialog.js index c370b7c9fe..e2741b36f9 100644 --- a/src/components/views/dialogs/InviteDialog.js +++ b/src/components/views/dialogs/InviteDialog.js @@ -381,10 +381,8 @@ export default class InviteDialog extends React.PureComponent { _buildSuggestions(excludedTargetIds: Set): {userId: string, user: RoomMember} { const maxConsideredMembers = 200; - const client = MatrixClientPeg.get(); - const joinedRooms = client.getRooms() - .filter(r => r.getMyMembership() === 'join') - .filter(r => r.getJoinedMemberCount() <= maxConsideredMembers); + const joinedRooms = MatrixClientPeg.get().getRooms() + .filter(r => r.getMyMembership() === 'join' && r.getJoinedMemberCount() <= maxConsideredMembers); // Generates { userId: {member, rooms[]} } const memberRooms = joinedRooms.reduce((members, room) => {