aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2016-10-03 13:04:32 -0600
committerBen Johnson <benbjohnson@yahoo.com>2016-10-03 13:04:32 -0600
commit0d68f169c55a0b7823b9cd06c8b4955b7da673be (patch)
treeb030b5025c9984cc3cd55dba574b5e29e6de6dfd
parentMerge pull request #595 from namore/add_warning_foreach_keys (diff)
downloaddedo-0d68f169c55a0b7823b9cd06c8b4955b7da673be.tar.gz
dedo-0d68f169c55a0b7823b9cd06c8b4955b7da673be.tar.xz
Fix Stats.Sub() for Stats.TxN.
The subtraction for `TxN` was previously transposed which caused the result to be a negative number. This change alters the order to return the correct (positive) result.
-rw-r--r--db.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/db.go b/db.go
index 1223493..48da059 100644
--- a/db.go
+++ b/db.go
@@ -952,7 +952,7 @@ func (s *Stats) Sub(other *Stats) Stats {
diff.PendingPageN = s.PendingPageN
diff.FreeAlloc = s.FreeAlloc
diff.FreelistInuse = s.FreelistInuse
- diff.TxN = other.TxN - s.TxN
+ diff.TxN = s.TxN - other.TxN
diff.TxStats = s.TxStats.Sub(&other.TxStats)
return diff
}