Skip to content

Commit

Permalink
perf improvement: change string equality check to reference equals
Browse files Browse the repository at this point in the history
  • Loading branch information
Iman Malik committed Jun 3, 2022
1 parent 6c02fff commit 4517f89
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public ReadOnlyMemory<byte> SerializedJson
if (this.cachedUserAgentString != this.UserAgentContainer.UserAgent ||
this.cachedNumberOfClientCreated != CosmosClient.numberOfClientsCreated ||
this.cachedNumberOfActiveClient != CosmosClient.NumberOfActiveClients ||
this.cachedMachineId != VmMetadataApiHandler.GetMachineId())
!ReferenceEquals(this.cachedMachineId, VmMetadataApiHandler.GetMachineId()))
{
this.cachedNumberOfActiveClient = CosmosClient.NumberOfActiveClients;
this.cachedNumberOfClientCreated = CosmosClient.numberOfClientsCreated;
Expand Down

0 comments on commit 4517f89

Please sign in to comment.