Skip to content

Commit 88c576f

Browse files
Potential fix for code scanning alert no. 2: Missed opportunity to use Where
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: Phileco <[email protected]>
1 parent 09ec313 commit 88c576f

File tree

1 file changed

+2
-3
lines changed
  • csharp/extractor/Semmle.Extraction.CSharp/Entities/Types

1 file changed

+2
-3
lines changed

Diff for: csharp/extractor/Semmle.Extraction.CSharp/Entities/Types/TupleType.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ public override void Populate(TextWriter trapFile)
4545
trapFile.tuple_underlying_type(this, underlyingType);
4646

4747
var index = 0;
48-
foreach (var element in TupleElements)
48+
foreach (var element in TupleElements.Where(e => e is not null))
4949
{
50-
if (element is not null)
51-
trapFile.tuple_element(this, index++, element);
50+
trapFile.tuple_element(this, index++, element);
5251
}
5352

5453
// Note: symbol.Locations seems to be very inconsistent

0 commit comments

Comments
 (0)