Skip to content

Commit 6c1d1f4

Browse files
committed
Fix invalid code
1 parent f399219 commit 6c1d1f4

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

shared/src/Datadog.Trace.ClrProfiler.Native/cor_profiler.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,9 @@ namespace datadog::shared::nativeloader
250250
}
251251

252252
// AAS checks
253-
const auto isRunningInAas = TryParseBooleanEnvironmentValue(
254-
GetEnvironmentValue(EnvironmentVariables::IsAzureAppServicesExtension),
255-
isRunningInAas) && isRunningInAas;
256-
if (isRunningInAas)
253+
bool isRunningInAas;
254+
if (TryParseBooleanEnvironmentValue(GetEnvironmentValue(EnvironmentVariables::IsAzureAppServicesExtension),
255+
isRunningInAas) && isRunningInAas)
257256
{
258257
Log::Info("Azure App Services detected.");
259258

@@ -283,13 +282,11 @@ namespace datadog::shared::nativeloader
283282
if (!functions_worker_runtime_value.empty())
284283
{
285284
// enabled by default
286-
const auto azure_functions_enabled = !TryParseBooleanEnvironmentValue(
287-
GetEnvironmentValue(
288-
EnvironmentVariables::AzureFunctionsInstrumentationEnabled),
289-
azure_functions_enabled)
290-
|| azure_functions_enabled;
291-
292-
if (!azure_functions_enabled)
285+
bool azure_functions_enabled;
286+
if (!TryParseBooleanEnvironmentValue(
287+
GetEnvironmentValue(
288+
EnvironmentVariables::AzureFunctionsInstrumentationEnabled),
289+
azure_functions_enabled) || !azure_functions_enabled)
293290
{
294291
Log::Info("DATADOG TRACER DIAGNOSTICS - ClrProfiler explicitly disabled for Azure Functions.");
295292
return CORPROF_E_PROFILER_CANCEL_ACTIVATION;

0 commit comments

Comments
 (0)