Skip to content

Commit

Permalink
perf(Presence): prefer boolean client status comparison before activi…
Browse files Browse the repository at this point in the history
…ty checks (#10213)

Prefer boolean client status comparison before activity checks

Co-authored-by: Jacob Morrison <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Apr 20, 2024
1 parent 6759f5b commit 4ad2858
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/discord.js/src/structures/Presence.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])))
);
}

Expand Down

0 comments on commit 4ad2858

Please sign in to comment.