From 4517f89a457ab3a157bfc85ebb21fbb2b9be75f4 Mon Sep 17 00:00:00 2001 From: Iman Malik Date: Fri, 3 Jun 2022 12:59:01 -0400 Subject: [PATCH] perf improvement: change string equality check to reference equals --- .../src/Tracing/TraceData/ClientConfigurationTraceDatum.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientConfigurationTraceDatum.cs b/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientConfigurationTraceDatum.cs index 64b59df041..dff3ec159c 100644 --- a/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientConfigurationTraceDatum.cs +++ b/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientConfigurationTraceDatum.cs @@ -58,7 +58,7 @@ public ReadOnlyMemory 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;