Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocklog: Return std::optional for head_id #1351

Merged
merged 3 commits into from
Jun 29, 2023
Merged

Blocklog: Return std::optional for head_id #1351

merged 3 commits into from
Jun 29, 2023

Conversation

heifner
Copy link
Member

@heifner heifner commented Jun 28, 2023

Minor refactor to make code cleaner/clearer. Return empty optional when block log does not have a current head.

Resolves #1289

@heifner heifner added the OCI Work exclusive to OCI team label Jun 28, 2023
@greg7mdp
Copy link
Contributor

greg7mdp commented Jun 28, 2023

Upon reflection, it seems that we either have both { head, head_id }, or they are both null.

Maybe the optional should be std::optional<signed_block_ptr, block_id_type> head;, so it is clear that either both are present or none.

@heifner
Copy link
Member Author

heifner commented Jun 28, 2023

Upon reflection, it seems that we either have both { head, head_id }, or they are both null.

Maybe the optional should be std::optional<signed_block_ptr, block_id_type> head;, so it is clear that either both are present or none.

That does make it clearer. Done.

@heifner heifner merged commit b27f0a0 into main Jun 29, 2023
21 checks passed
@heifner heifner deleted the GH-1289-block-log branch June 29, 2023 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update block_log and fork_db to return empty std::optional when requested data not present
3 participants