mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-07 13:18:43 +02:00
refactor: return reference instead of pointer
The return value of BlockManager::GetFirstBlock must always be non-null. This can be inferred by the implementation, which has an assertion that the return value is not null. A raw pointer should only be returned if the result may be null. In this case a reference is more appropriate.
This commit is contained in:
@@ -422,11 +422,11 @@ public:
|
||||
* @param lower_block The earliest possible block to return. If null, the
|
||||
* search can extend to the genesis block.
|
||||
*
|
||||
* @return A non-null pointer to the earliest block between `upper_block`
|
||||
* @return A reference to the earliest block between `upper_block`
|
||||
* and `lower_block`, inclusive, such that every block between the
|
||||
* returned block and `upper_block` has `status_mask` flags set.
|
||||
*/
|
||||
const CBlockIndex* GetFirstBlock(
|
||||
const CBlockIndex& GetFirstBlock(
|
||||
const CBlockIndex& upper_block LIFETIMEBOUND,
|
||||
uint32_t status_mask,
|
||||
const CBlockIndex* lower_block LIFETIMEBOUND = nullptr
|
||||
|
||||
Reference in New Issue
Block a user