Skip to content

Commit

Permalink
fix(lib/events/filesessions): replace int64 conversion with comparison
Browse files Browse the repository at this point in the history
This prevents any unsafe int64 to int conversions.
  • Loading branch information
dustinspecker committed Jan 2, 2025
1 parent 1923bd0 commit 4b80998
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/events/filesessions/fileasync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,11 @@ func readStream(ctx context.Context, t *testing.T, uploadID string, uploader *ev

// sort audit events by index
slices.SortStableFunc(outEvents, func(a apievents.AuditEvent, b apievents.AuditEvent) int {
return int(a.GetIndex() - b.GetIndex())
if a.GetIndex() < b.GetIndex() {
return -1
}

return 1
})

// remove any audit events with duplicate indexes
Expand Down

0 comments on commit 4b80998

Please sign in to comment.