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:
Jacob Morrison
2024-04-20 19:08:26 -04:00
committed by GitHub
parent 6759f5b9c5
commit 4ad285804b

View File

@@ -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])))
);
}