Skip to content

Commit

Permalink
backport: User#dmChannel perf enhancement (#2780)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranet authored and SpaceEEC committed Aug 22, 2018
1 parent 7684ad3 commit 911e289
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/structures/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class User {
* @readonly
*/
get dmChannel() {
return this.client.channels.filter(c => c.type === 'dm').find(c => c.recipient.id === this.id);
return this.client.channels.find(c => c.type === 'dm' && c.recipient.id === this.id);
}

/**
Expand Down

0 comments on commit 911e289

Please sign in to comment.