mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-24 18:21:38 +00:00
Merge pull request #1191 from tendermint/event-buffer-slice-clearing-on-flush
types: TxEventBuffer.Flush now uses capacity preserving slice clearing idiom
This commit is contained in:
@ -41,6 +41,10 @@ func (b *TxEventBuffer) Flush() error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
b.events = make([]EventDataTx, 0, b.capacity)
|
||||
|
||||
// Clear out the elements and set the length to 0
|
||||
// but maintain the underlying slice's capacity.
|
||||
// See Issue https://github.com/tendermint/tendermint/issues/1189
|
||||
b.events = b.events[:0]
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user