From 0d68f169c55a0b7823b9cd06c8b4955b7da673be Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Mon, 3 Oct 2016 13:04:32 -0600 Subject: [PATCH] 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. --- db.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }