Merge pull request #1938 from famedly/krille/use-object-hash

refactor: Use Object.hash instead of hashCode ^
This commit is contained in:
Krille-chan 2024-10-16 15:48:06 +02:00 committed by GitHub
commit d243116ae1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 13 deletions

View File

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

View File

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

View File

@ -35,5 +35,5 @@ class CallParticipant {
deviceId == other.deviceId;
@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;
@override
int get hashCode => roomId.hashCode ^ callId.hashCode;
int get hashCode => Object.hash(roomId.hashCode, callId.hashCode);
}