Browse Source

use nil slice when expected length is 0

wb/txrset
William Banfield 3 years ago
parent
commit
ee2a9a1620
No known key found for this signature in database GPG Key ID: EFAD3442BF29E3AC
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      abci/types/types.go

+ 2
- 2
abci/types/types.go View File

@ -224,7 +224,7 @@ func (rpp *ResponsePrepareProposal) IncludedTxs() []*TxRecord {
// RemovedTxs returns all of the TxRecords that are marked for removal from the
// mempool.
func (rpp *ResponsePrepareProposal) RemovedTxs() []*TxRecord {
trs := []*TxRecord{}
var trs []*TxRecord
for _, tr := range rpp.TxRecords {
if tr.Action == TxRecord_REMOVED {
trs = append(trs, tr)
@ -235,7 +235,7 @@ func (rpp *ResponsePrepareProposal) RemovedTxs() []*TxRecord {
// AddedTxs returns all of the TxRecords that are marked as added to the proposal.
func (rpp *ResponsePrepareProposal) AddedTxs() []*TxRecord {
trs := []*TxRecord{}
var trs []*TxRecord
for _, tr := range rpp.TxRecords {
if tr.Action == TxRecord_ADDED {
trs = append(trs, tr)


Loading…
Cancel
Save