Skip to content

Commit 5c75853

Browse files
committed
refactor: sort the field on the struct
1 parent 9631a79 commit 5c75853

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

internal/output/table.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,13 @@ func tableBuilderInner(vulnResult *models.VulnerabilityResults, calledVulns bool
209209
source.Path = sourcePath
210210
}
211211

212-
sorted := pkg.Groups
213-
214212
// Ensure that groups are sorted consistently using the first ID in each group
215-
slices.SortFunc(sorted, func(a, b models.GroupInfo) int {
213+
slices.SortFunc(pkg.Groups, func(a, b models.GroupInfo) int {
216214
return identifiers.IDSortFunc(a.IDs[0], b.IDs[0])
217215
})
218216

219217
// Merge groups into the same row
220-
for _, group := range sorted {
218+
for _, group := range pkg.Groups {
221219
if !(group.IsCalled() == calledVulns && group.IsGroupUnimportant() == unimportantVulns) {
222220
continue
223221
}

0 commit comments

Comments
 (0)