backport: User#dmChannel perf enhancement (#2780)

This commit is contained in:
Kyra
2018-08-22 11:52:21 +02:00
committed by SpaceEEC
parent 7684ad3ca6
commit 911e289b55

View File

@@ -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);
}
/**