refactor: Use Object.hash instead of hashCode ^

This commit is contained in:
Krille 2024-10-16 15:13:30 +02:00
parent 3e35120aa1
commit 2d73192a40
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652
4 changed files with 17 additions and 13 deletions

View File

@ -462,8 +462,11 @@ class LiveKitBackend extends CallBackend {
livekitAlias == other.livekitAlias; livekitAlias == other.livekitAlias;
@override @override
int get hashCode => int get hashCode => Object.hash(
type.hashCode ^ livekitServiceUrl.hashCode ^ livekitAlias.hashCode; type.hashCode,
livekitServiceUrl.hashCode,
livekitAlias.hashCode,
);
/// get everything else from your livekit sdk in your client /// get everything else from your livekit sdk in your client
@override @override

View File

@ -103,15 +103,16 @@ class CallMembership {
membershipId == other.membershipId; membershipId == other.membershipId;
@override @override
int get hashCode => int get hashCode => Object.hash(
userId.hashCode ^ userId.hashCode,
roomId.hashCode ^ roomId.hashCode,
callId.hashCode ^ callId.hashCode,
application.hashCode ^ application.hashCode,
scope.hashCode ^ scope.hashCode,
backend.type.hashCode ^ backend.type.hashCode,
deviceId.hashCode ^ deviceId.hashCode,
membershipId.hashCode; membershipId.hashCode,
);
// with a buffer of 1 minute just incase we were slow to process a // with a buffer of 1 minute just incase we were slow to process a
// call event, if the device is actually dead it should // call event, if the device is actually dead it should

View File

@ -35,5 +35,5 @@ class CallParticipant {
deviceId == other.deviceId; deviceId == other.deviceId;
@override @override
int get hashCode => userId.hashCode ^ deviceId.hashCode; int get hashCode => Object.hash(userId.hashCode, deviceId.hashCode);
} }

View File

@ -20,5 +20,5 @@ class VoipId {
other is VoipId && roomId == other.roomId && callId == other.callId; other is VoipId && roomId == other.roomId && callId == other.callId;
@override @override
int get hashCode => roomId.hashCode ^ callId.hashCode; int get hashCode => Object.hash(roomId.hashCode, callId.hashCode);
} }