1
0
mirror of https://github.com/etcd-io/bbolt.git synced 2025-04-28 05:33:17 +00:00

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.
This commit is contained in:
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

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