Skip to content

Commit a5a4c37

Browse files
committed
format
1 parent a9a3c3f commit a5a4c37

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

internal/pool/want_conn_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -366,17 +366,17 @@ func TestWantConnQueue_ThreadSafety(t *testing.T) {
366366
// Benchmark tests
367367
func BenchmarkWantConnQueue_Enqueue(b *testing.B) {
368368
q := newWantConnQueue()
369-
370-
// Pre-allocate a pool of wantConn to reuse
369+
370+
// Pre-allocate a pool of wantConn to reuse
371371
const poolSize = 1000
372372
wantConnPool := make([]*wantConn, poolSize)
373373
for i := 0; i < poolSize; i++ {
374374
wantConnPool[i] = &wantConn{
375-
ctx: context.Background(),
375+
ctx: context.Background(),
376376
result: make(chan wantConnResult, 1),
377377
}
378378
}
379-
379+
380380
b.ResetTimer()
381381

382382
for i := 0; i < b.N; i++ {
@@ -390,7 +390,7 @@ func BenchmarkWantConnQueue_Dequeue(b *testing.B) {
390390

391391
// Use a reasonable fixed size for pre-population to avoid memory issues
392392
const queueSize = 10000
393-
393+
394394
// Pre-populate queue with a fixed reasonable size
395395
for i := 0; i < queueSize; i++ {
396396
w := &wantConn{
@@ -401,7 +401,7 @@ func BenchmarkWantConnQueue_Dequeue(b *testing.B) {
401401
}
402402

403403
b.ResetTimer()
404-
404+
405405
// Benchmark dequeue operations, refilling as needed
406406
for i := 0; i < b.N; i++ {
407407
if _, ok := q.dequeue(); !ok {
@@ -421,7 +421,7 @@ func BenchmarkWantConnQueue_Dequeue(b *testing.B) {
421421

422422
func BenchmarkWantConnQueue_EnqueueDequeue(b *testing.B) {
423423
q := newWantConnQueue()
424-
424+
425425
// Pre-allocate a pool of wantConn to reuse
426426
const poolSize = 1000
427427
wantConnPool := make([]*wantConn, poolSize)
@@ -431,7 +431,7 @@ func BenchmarkWantConnQueue_EnqueueDequeue(b *testing.B) {
431431
result: make(chan wantConnResult, 1),
432432
}
433433
}
434-
434+
435435
b.ResetTimer()
436436

437437
for i := 0; i < b.N; i++ {

0 commit comments

Comments
 (0)