Use for..in rather than an indexed loop.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
e456d87cbf
commit
7555a7c26a
|
@ -103,10 +103,7 @@ void checkNumberOfUniqueAddresses(int nUnique) {
|
|||
|
||||
int GetMaxFundingStreamHeight(const Consensus::Params& params) {
|
||||
int result = 0;
|
||||
for (uint32_t idx = Consensus::FIRST_FUNDING_STREAM; idx < Consensus::MAX_FUNDING_STREAMS; idx++) {
|
||||
// The following indexed access is safe as Consensus::MAX_FUNDING_STREAMS is used
|
||||
// in the definition of vFundingStreams.
|
||||
auto fs = params.vFundingStreams[idx];
|
||||
for (auto fs : params.vFundingStreams) {
|
||||
if (fs && result < fs.get().GetEndHeight() - 1) {
|
||||
result = fs.get().GetEndHeight() - 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue