From 911e289b5590045457ad1b594f3be64beeccbe6e Mon Sep 17 00:00:00 2001 From: Kyra Date: Wed, 22 Aug 2018 11:52:21 +0200 Subject: [PATCH] backport: User#dmChannel perf enhancement (#2780) --- src/structures/User.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/structures/User.js b/src/structures/User.js index 08ce895a9..e7f5b9228 100644 --- a/src/structures/User.js +++ b/src/structures/User.js @@ -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); } /**