From cd565148084b3539b365820cc06ca2272b7683a5 Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Fri, 25 Apr 2014 13:18:50 -0600 Subject: [PATCH] pass by address --- server/util_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/util_test.go b/server/util_test.go index 6cfa6f58..f68de759 100644 --- a/server/util_test.go +++ b/server/util_test.go @@ -24,7 +24,7 @@ func BenchmarkParseSize(b *testing.B) { } } -func deferUnlock(mu sync.Mutex) { +func deferUnlock(mu *sync.Mutex) { mu.Lock() defer mu.Unlock() } @@ -33,11 +33,11 @@ func BenchmarkDeferMutex(b *testing.B) { var mu sync.Mutex b.SetBytes(1) for i := 0; i < b.N; i++ { - deferUnlock(mu) + deferUnlock(&mu) } } -func noDeferUnlock(mu sync.Mutex) { +func noDeferUnlock(mu *sync.Mutex) { mu.Lock() mu.Unlock() } @@ -46,6 +46,6 @@ func BenchmarkNoDeferMutex(b *testing.B) { var mu sync.Mutex b.SetBytes(1) for i := 0; i < b.N; i++ { - noDeferUnlock(mu) + noDeferUnlock(&mu) } }