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:
parent
fff57c100f
commit
0d68f169c5
2
db.go
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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user