Makes the code smaller and easier to read
test: Use std::unique_ptr over manual delete in coins_tests #27004
pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2301-test-uniq-ptr-🕴 changing 1 files +17 −37-
maflcko commented at 10:18 AM on January 31, 2023: member
-
DrahtBot commented at 10:18 AM on January 31, 2023: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process.
Type Reviewers ACK stickies-v, john-moffett If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
No conflicts as of last run.
- DrahtBot added the label Tests on Jan 31, 2023
-
test: Use std::unique_ptr over manual delete in coins_tests fab9f7d1bd
- maflcko force-pushed on Jan 31, 2023
- fanquake requested review from stickies-v on Feb 2, 2023
-
in src/test/coins_tests.cpp:917 in fab9f7d1bd
913 | @@ -928,7 +914,7 @@ void TestFlushBehavior( 914 | auto flush_all = [&all_caches](bool erase) { 915 | // Flush in reverse order to ensure that flushes happen from children up. 916 | for (auto i = all_caches.rbegin(); i != all_caches.rend(); ++i) { 917 | - auto cache = *i; 918 | + auto& cache = *i;
stickies-v commented at 3:24 PM on February 2, 2023:nit
auto& cache{*i};stickies-v approvedstickies-v commented at 3:35 PM on February 2, 2023: contributorACK fab9f7d1bd48198d3e0d3c3a08e404ea73a2bc8d
Not having to worry about dynamically allocated memory is 👍 Can't see any behaviour change.
fanquake requested review from john-moffett on Feb 2, 2023john-moffett approvedjohn-moffett commented at 4:43 PM on February 2, 2023: contributorACK fab9f7d1bd48198d3e0d3c3a08e404ea73a2bc8d
Definite improvement. No issues or behavior changes I can see.
fanquake merged this on Feb 2, 2023fanquake closed this on Feb 2, 2023maflcko deleted the branch on Feb 3, 2023sidhujag referenced this in commit 68e3f79a05 on Feb 3, 2023bitcoin locked this on Feb 3, 2024ContributorsLabels
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-24 09:14 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-24 09:14 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me