perf(Presence): prefer boolean client status comparison before activity checks

#10213 backport
This commit is contained in:
Elysia
2024-09-17 18:44:29 +07:00
parent c1367507aa
commit bd1d157552

View File

@@ -161,11 +161,11 @@ class Presence extends Base {
this === presence || this === presence ||
(presence && (presence &&
this.status === presence.status && 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?.web === presence.clientStatus?.web &&
this.clientStatus?.mobile === presence.clientStatus?.mobile && 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])))
); );
} }