diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-03-22 06:42:01 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-03-22 06:42:04 +0100 |
commit | 786654aa5e0b7a7f91404e8fb9c3b2a7f7a421ba (patch) | |
tree | 2cb8954fa798770bfa7104c804cc666572538446 /src/util | |
parent | 80cb51cc6b417fb7b23fc8b299f0605e7f82c62d (diff) | |
parent | 5294f0d5a94cc7beaf692131fba0cad8beec9f13 (diff) | |
download | bitcoin-786654aa5e0b7a7f91404e8fb9c3b2a7f7a421ba.tar.xz |
Merge #21498: refactor: return std::nullopt instead of {}
5294f0d5a94cc7beaf692131fba0cad8beec9f13 refactor: return std::nullopt instead of {} (fanquake)
Pull request description:
In #21415 [we decided](https://github.com/bitcoin/bitcoin/pull/21415#issuecomment-800236640) to return `std::optional` rather than `{}` for
uninitialized values. This PR replaces the two remaining usages of `{}`
with `std::nullopt`.
As a side-effect, this also quells the spurious GCC 10.2.x warning that
we've had reported quite a few times. i.e #21318, #21248, #20797.
```bash
txmempool.cpp: In member function ‘CTxMemPool::setEntries CTxMemPool::GetIterSet(const std::set<uint256>&) const’:
txmempool.cpp:898:13: warning: ‘<anonymous>’ may be used uninitialized in this function [-Wmaybe-uninitialized]
898 | return {};
| ^
```
ACKs for top commit:
hebasto:
ACK 5294f0d5a94cc7beaf692131fba0cad8beec9f13, I have reviewed the code and it looks OK, I agree it can be merged.
Tree-SHA512: 5b776be79ab26e5a3a5fc2b463b394ea5ce6797ed5558424873fa4ecee2898170eff76d6da9d69394d28f8f98974117fc63b922a3e19c52f5294c83073e79bb0
Diffstat (limited to 'src/util')
0 files changed, 0 insertions, 0 deletions