From 4ad285804bfd72b157139dde61c3fd8ac2544322 Mon Sep 17 00:00:00 2001 From: Jacob Morrison Date: Sat, 20 Apr 2024 19:08:26 -0400 Subject: [PATCH] perf(Presence): prefer boolean client status comparison before activity checks (#10213) Prefer boolean client status comparison before activity checks Co-authored-by: Jacob Morrison Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/discord.js/src/structures/Presence.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/discord.js/src/structures/Presence.js b/packages/discord.js/src/structures/Presence.js index a73be719f2fd..c1d945fe3b06 100644 --- a/packages/discord.js/src/structures/Presence.js +++ b/packages/discord.js/src/structures/Presence.js @@ -123,11 +123,11 @@ class Presence extends Base { this === presence || (presence && this.status === presence.status && - this.activities.length === presence.activities.length && - this.activities.every((activity, index) => activity.equals(presence.activities[index])) && this.clientStatus?.web === presence.clientStatus?.web && this.clientStatus?.mobile === presence.clientStatus?.mobile && - this.clientStatus?.desktop === presence.clientStatus?.desktop) + this.clientStatus?.desktop === presence.clientStatus?.desktop && + this.activities.length === presence.activities.length && + this.activities.every((activity, index) => activity.equals(presence.activities[index]))) ); }