HomePhabricator

Merge #10493: Use range-based for loops (C++11) when looping over map elements

Description

Merge #10493: Use range-based for loops (C++11) when looping over map elements

Summary:
680bc2cbb Use range-based for loops (C++11) when looping over map elements (practicalswift)

Pull request description:

Before this commit:

```c++
for (std::map<T1, T2>::iterator x = y.begin(); x != y.end(); ++x) {
    T1 z = (*x).first;
    …
}
```

After this commit:

```c++
for (auto& x : y) {
    T1 z = x.first;
    …
}
```

Tree-SHA512: 954b136b7f5e6df09f39248a6b530fd9baa9ab59d7c2c7eb369fd4afbb591b7a52c92ee25f87f1745f47b41d6828b7abfd395b43daf84a55b4e6a3d45015e3a0

Backport of Core PR 10493
https://github.com/bitcoin/bitcoin/pull/10493/files
Completes T577

Note: Many pre-patch lines in this diff do not match the original PR.
This is due to refactors that we've done and out-of-order backports.
If you are unsure, please git blame on master to find the associated refactor before this diff.
If you are still unsure, ask via a comment.

The changes in qt/bantablemodel.cpp were skipped because they were already applied in a past refactor.

Test Plan: make check

Reviewers: deadalnix, Fabien, #bitcoin_abc

Reviewed By: deadalnix, #bitcoin_abc

Subscribers: schancel

Differential Revision: https://reviews.bitcoinabc.org/D2775

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Nov 30 2017, 22:09
jasonbcoxCommitted on Apr 8 2019, 23:53
nakihitoPushed on Apr 9 2019, 01:06
Reviewer
Restricted Project
Differential Revision
D2775: Merge #10493: Use range-based for loops (C++11) when looping over map elements
Parents
rSTAGING4d5a8ec972e2: doc: update FreeBSD build guide for 12.0
Branches
Unknown
Tags
Unknown
References
tag: phabricator/base/8003