addrbook_test: preallocate memory for bookSizes (#3268)

Fixes https://circleci.com/gh/tendermint/tendermint/44901
This commit is contained in:
Anton Kaliaev 2019-02-07 17:16:31 +04:00 committed by GitHub
parent 354a08c25a
commit 11e36d0bfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -528,7 +528,7 @@ func TestMultipleAddrBookAddressSelection(t *testing.T) {
// Test for two books with sizes from following ranges // Test for two books with sizes from following ranges
ranges := [...][]int{{33, 100}, {100, 175}} ranges := [...][]int{{33, 100}, {100, 175}}
var bookSizes []int bookSizes := make([]int, 0, len(ranges))
for _, r := range ranges { for _, r := range ranges {
bookSizes = append(bookSizes, cmn.RandIntn(r[1]-r[0])+r[0]) bookSizes = append(bookSizes, cmn.RandIntn(r[1]-r[0])+r[0])
} }