Remove double iteration (#2773)

This commit is contained in:
Frangu Vlad
2018-08-19 14:37:00 +03:00
committed by Crawl
parent 68c832957d
commit 4a24e8c12c

View File

@@ -185,7 +185,7 @@ class User extends Base {
* @readonly
*/
get dmChannel() {
return this.client.channels.filter(c => c.type === 'dm').find(c => c.recipient.id === this.id) || null;
return this.client.channels.find(c => c.type === 'dm' && c.recipient.id === this.id) || null;
}
/**