Skip to content

Commit

Permalink
null check
Browse files Browse the repository at this point in the history
  • Loading branch information
rajkumar-rangaraj committed Dec 11, 2024
1 parent 4328df7 commit 269297e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ internal static int TryWriteResourceLogs(ref byte[] buffer, int writePosition, S

internal static void ReturnLogRecordListToPool()
{
if (scopeLogsList.Count != 0)
if (scopeLogsList?.Count != 0)
{
foreach (var entry in scopeLogsList)
foreach (var entry in scopeLogsList!)
{
foreach (var logRecord in entry.Value)
{
Expand All @@ -101,7 +101,7 @@ internal static void ReturnLogRecordListToPool()
}

entry.Value.Clear();
logsListPool.Push(entry.Value);
logsListPool?.Push(entry.Value);
}

scopeLogsList.Clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ internal static int TryWriteResourceMetrics(ref byte[] buffer, int writePosition

private static void ReturnMetricListToPool()
{
if (scopeMetricsList.Count != 0)
if (scopeMetricsList?.Count != 0)
{
foreach (var entry in scopeMetricsList)
foreach (var entry in scopeMetricsList!)
{
entry.Value.Clear();
metricListPool.Push(entry.Value);
metricListPool?.Push(entry.Value);
}

scopeMetricsList.Clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ internal static int TryWriteResourceSpans(ref byte[] buffer, int writePosition,
}

internal static void ReturnActivityListToPool()
{
if (scopeTracesList.Count != 0)
{
if (scopeTracesList?.Count != 0)
{
foreach (var entry in scopeTracesList)
foreach (var entry in scopeTracesList!)
{
entry.Value.Clear();
activityListPool.Push(entry.Value);
activityListPool?.Push(entry.Value);
}

scopeTracesList.Clear();
Expand Down

0 comments on commit 269297e

Please sign in to comment.