mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
perf(Presence): prefer boolean client status comparison before activity checks (#10213)
Prefer boolean client status comparison before activity checks Co-authored-by: Jacob Morrison <jake@matchmd.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -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])))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user