Skip to content

Commit

Permalink
Small tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-romano-DD committed Sep 27, 2024
1 parent e95d135 commit 7ec617a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tracer/src/Datadog.Trace/Iast/Ranges.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ internal static Range[] CopyWithMark(Range[] ranges, SecureMarks secureMarks)
return newRanges.ToArray();
}

internal static Range[]? GetUnsafeRanges(Range[] ranges, SecureMarks safeMarks, SourceType[]? safeSources)
internal static Range[] GetUnsafeRanges(Range[] ranges, SecureMarks safeMarks, SourceType[]? safeSources)
{
if (safeMarks == SecureMarks.None && safeSources is null)
{
Expand All @@ -229,6 +229,10 @@ internal static Range[] CopyWithMark(Range[] ranges, SecureMarks secureMarks)
// This is made in order to avoid unnecessary allocations (most common situation)
return ranges;
}
else if (insecureCount == 0)
{
return [];
}

Range[] insecureRanges = new Range[insecureCount];
int i = 0;
Expand Down

0 comments on commit 7ec617a

Please sign in to comment.