From ee2a9a1620a1e683d8c5893dedff2113c1cdfcac Mon Sep 17 00:00:00 2001 From: William Banfield Date: Wed, 9 Mar 2022 14:01:42 -0500 Subject: [PATCH] use nil slice when expected length is 0 --- abci/types/types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/abci/types/types.go b/abci/types/types.go index 59aaaebc8..ba7fd0d0d 100644 --- a/abci/types/types.go +++ b/abci/types/types.go @@ -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)