HomePhabricator

Merge #11353: Small refactor of CCoinsViewCache::BatchWrite()

Description

Merge #11353: Small refactor of CCoinsViewCache::BatchWrite()

Summary:
5b9748f97 Small refactor of CCoinsViewCache::BatchWrite() (Dan Raviv)

Pull request description:

`std::unordered_map::erase( const_iterator pos )` returns an iterator to the element following the removed one. Use that to optimize (probably minor-performance-wise, and definitely code-structure-wise) the implementation of `CCoinsViewCache::BatchWrite()`.

Tree-SHA512: 00abc838ad91771cfcddd45688841c9414869b75289d09b483a7f0ba835614fe189e9c8aca8a80e3de78ee397ec14083ae52e2e92b7863b3b6eb0d0cb892c9dd

Backport of Core PR11353
https://github.com/bitcoin/bitcoin/pull/11353/

Review note: mostly indentation changes from the linter. The main
changes are to the loop initialization, the first if statement, and
some bracket additions.

Test Plan:

make check
test_runner.py

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc

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

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Nov 10 2017, 19:22
nakihitoCommitted on Aug 16 2019, 18:32
nakihitoPushed on Aug 16 2019, 18:32
Reviewer
Restricted Owners Package
Differential Revision
D3879: Merge #11353: Small refactor of CCoinsViewCache::BatchWrite()
Parents
rABC7ee85b34ec74: Merge #12621: Avoid querying unnecessary model data when filtering transactions
Branches
Unknown
Tags
Unknown