Skip to content

Commit 82a081d

Browse files
committed
fix: changes made to address sonarcloud warnings
1 parent 68aec34 commit 82a081d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

application/CohortManager/src/Functions/Shared/Data/Database/ExtractCohortDistributionRecords.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ private async Task<List<CohortDistribution>> GetSupersededParticipants(int rowCo
4040

4141
// Get distinct non-null superseded NHS numbers
4242
var supersededNhsNumbers = supersededParticipants
43-
.Select(sp => sp.SupersededNHSNumber)
44-
.Where(nhs => nhs.HasValue)
45-
.Select(nhs => nhs.Value)
43+
.Select(sp => sp.SupersededNHSNumber.Value)
4644
.Distinct()
4745
.ToList();
4846

@@ -56,7 +54,7 @@ private async Task<List<CohortDistribution>> GetSupersededParticipants(int rowCo
5654
}
5755

5856
// Filter superseded participants that have matching records
59-
var filteredParticipants = supersededParticipants.ToList()
57+
var filteredParticipants = supersededParticipants
6058
.Where(sp => matchingParticipants.Any(mp => mp.NHSNumber == sp.SupersededNHSNumber))
6159
.ToList();
6260

0 commit comments

Comments
 (0)