File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ func BenchmarkMemoryCache_Drain(b *testing.B) {
142142 ctx := context .Background ()
143143
144144 // Pre-populate cache with many items
145- for i := 0 ; i < 1000 ; i ++ {
145+ for i := range 1000 {
146146 key := "item-" + strconv .Itoa (i )
147147 value := "value-" + strconv .Itoa (i )
148148 cache .Set (ctx , key , []byte (value ))
Original file line number Diff line number Diff line change @@ -58,12 +58,12 @@ func TestMemoryCache_ConcurrentWrites(t *testing.T) {
5858 var wg sync.WaitGroup
5959
6060 // Launch multiple concurrent writes
61- for i := 0 ; i < numGoroutines ; i ++ {
61+ for i := range numGoroutines {
6262 wg .Add (1 )
6363 go func (goroutineID int ) {
6464 defer wg .Done ()
6565
66- for j := 0 ; j < numKeys / numGoroutines ; j ++ {
66+ for j := range numKeys / numGoroutines {
6767 key := "key-" + strconv .Itoa (goroutineID ) + "-" + strconv .Itoa (j )
6868 value := "value-" + strconv .Itoa (goroutineID ) + "-" + strconv .Itoa (j )
6969
@@ -78,8 +78,8 @@ func TestMemoryCache_ConcurrentWrites(t *testing.T) {
7878 wg .Wait ()
7979
8080 // Verify all keys were set correctly
81- for i := 0 ; i < numGoroutines ; i ++ {
82- for j := 0 ; j < numKeys / numGoroutines ; j ++ {
81+ for i := range numGoroutines {
82+ for j := range numKeys / numGoroutines {
8383 key := "key-" + strconv .Itoa (i ) + "-" + strconv .Itoa (j )
8484 expectedValue := "value-" + strconv .Itoa (i ) + "-" + strconv .Itoa (j )
8585
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ func TestMemoryCache_MemoryPressure(t *testing.T) {
125125 tempCache := cache .NewMemory (0 )
126126
127127 // Add items to cache
128- for j := 0 ; j < itemsPerCache ; j ++ {
128+ for j := range itemsPerCache {
129129 key := "pressure-key-" + strconv .Itoa (i ) + "-" + strconv .Itoa (j )
130130 value := "pressure-value-" + strconv .Itoa (i ) + "-" + strconv .Itoa (j )
131131
You can’t perform that action at this time.
0 commit comments