Skip to content

Commit

Permalink
Use range over int in benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed Feb 24, 2025
1 parent 1d2eadd commit d79a949
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/transport/completion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func BenchmarkNameplateCompletion(b *testing.B) {

local := []string{}

for i := 0; i < b.N; i++ {
for range b.N {
local = c.GenerateCodeCompletion("1-letterhead-be")
}

Expand Down
2 changes: 1 addition & 1 deletion internal/ui/tabs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func BenchmarkCreate(b *testing.B) {
b.StartTimer()

b.ReportAllocs()
for i := 0; i < b.N; i++ {
for range b.N {
tabs = Create(a, w)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var globalValidationError error
func BenchmarkCodeValidator(b *testing.B) {
local := error(nil)

for i := 0; i < b.N; i++ {
for range b.N {
local = CodeValidator("125-upset-universe-mistake")
}

Expand Down

0 comments on commit d79a949

Please sign in to comment.