Skip to content

Commit 62ffd16

Browse files
committed
Replace Hashtable with hashtable literals for improved performance in Build-NotCheckedSectionHtml function
1 parent 984a2ee commit 62ffd16

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

invoke-adoqr.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,7 +1412,7 @@ function Build-NotCheckedSectionHtml {
14121412
if ($items.Count -eq 0) { return '' }
14131413

14141414
$reasonCards = [System.Text.StringBuilder]::new()
1415-
$reasonCounts = New-Object System.Collections.Hashtable
1415+
$reasonCounts = @{}
14161416
foreach ($item in $items) {
14171417
if (-not $reasonCounts.ContainsKey($item.Reason)) { $reasonCounts[$item.Reason] = 0 }
14181418
$reasonCounts[$item.Reason]++
@@ -1430,7 +1430,7 @@ function Build-NotCheckedSectionHtml {
14301430
}
14311431

14321432
$detailGroups = [System.Text.StringBuilder]::new()
1433-
$scopeGroups = New-Object System.Collections.Hashtable
1433+
$scopeGroups = @{}
14341434
foreach ($item in $items) {
14351435
if (-not $scopeGroups.ContainsKey($item.Scope)) { $scopeGroups[$item.Scope] = [System.Collections.Generic.List[PSCustomObject]]::new() }
14361436
$scopeGroups[$item.Scope].Add($item)

0 commit comments

Comments
 (0)