aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kobetic <mkobetic@gmail.com>2014-06-24 17:39:48 +0000
committerMartin Kobetic <mkobetic@gmail.com>2014-06-24 17:40:53 +0000
commitba79a0a355f2511adbc2c7356a3362da180548c8 (patch)
treee02d68cfc5844db5a274ad76c26714a78612237e
parentMerge pull request #212 from Shopify/stats_sub (diff)
downloaddedo-ba79a0a355f2511adbc2c7356a3362da180548c8.tar.gz
dedo-ba79a0a355f2511adbc2c7356a3362da180548c8.tar.xz
drop the *s guard
-rw-r--r--db.go10
1 files changed, 1 insertions, 9 deletions
diff --git a/db.go b/db.go
index d15dc74..6b43f43 100644
--- a/db.go
+++ b/db.go
@@ -575,15 +575,7 @@ type Stats struct {
// This is useful when obtaining stats at two different points and time and
// you need the performance counters that occurred within that time span.
func (s *Stats) Sub(other *Stats) Stats {
- var diff Stats
- if s == nil {
- if other == nil {
- return diff
- } else {
- return *other
- }
- }
- diff = *s
+ var diff = *s
if other == nil {
return diff
}