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.
master
Ben Johnson 2016-10-03 13:04:32 -06:00
parent fff57c100f
commit 0d68f169c5
No known key found for this signature in database
GPG Key ID: 81741CD251883081
1 changed files with 1 additions and 1 deletions

2
db.go
View File

@ -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
}