mirror of
https://github.com/etcd-io/bbolt.git
synced 2025-05-30 19:22:24 +00:00
review tweaks
This commit is contained in:
parent
ba79a0a355
commit
bae0fbd290
6
db.go
6
db.go
@ -575,11 +575,11 @@ type Stats struct {
|
||||
// This is useful when obtaining stats at two different points and time and
|
||||
// you need the performance counters that occurred within that time span.
|
||||
func (s *Stats) Sub(other *Stats) Stats {
|
||||
var diff = *s
|
||||
if other == nil {
|
||||
return diff
|
||||
return *s
|
||||
}
|
||||
diff.TxN = other.TxN - diff.TxN
|
||||
var diff Stat
|
||||
diff.TxN = other.TxN - s.TxN
|
||||
diff.TxStats = s.TxStats.Sub(&other.TxStats)
|
||||
return diff
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user