From d802f0e8bd28523c12371227e4f342a15bfca807 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Sat, 19 Mar 2016 16:10:34 +0200 Subject: [PATCH] Remove unneeded synchronization. --- redis.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/redis.go b/redis.go index aaa0dac8..d3289ba2 100644 --- a/redis.go +++ b/redis.go @@ -4,7 +4,6 @@ import ( "fmt" "log" "os" - "sync/atomic" "gopkg.in/redis.v3/internal/pool" ) @@ -170,12 +169,12 @@ func NewClient(opt *Options) *Client { func (c *Client) PoolStats() *PoolStats { s := c.connPool.Stats() return &PoolStats{ - Requests: atomic.LoadUint32(&s.Requests), - Hits: atomic.LoadUint32(&s.Hits), - Waits: atomic.LoadUint32(&s.Waits), - Timeouts: atomic.LoadUint32(&s.Timeouts), + Requests: s.Requests, + Hits: s.Hits, + Waits: s.Waits, + Timeouts: s.Timeouts, - TotalConns: atomic.LoadUint32(&s.TotalConns), - FreeConns: atomic.LoadUint32(&s.FreeConns), + TotalConns: s.TotalConns, + FreeConns: s.FreeConns, } }