Page MenuHomePhabricator

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

Authored by nakihito on Aug 14 2019, 20:51.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a reviewer: Restricted Owners Package.Aug 14 2019, 20:51
This revision is now accepted and ready to land.Aug 16 2019, 08:11