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

go/storage/mkvs: Fix commit of nil entries #5321

Merged
merged 3 commits into from Jul 14, 2023

Conversation

kostko
Copy link
Member

@kostko kostko commented Jul 13, 2023

No description provided.

@kostko kostko force-pushed the kostko/fix/mkvs-writelog-empty branch from 93ff8a4 to d214ecd Compare July 13, 2023 15:43
@kostko kostko marked this pull request as ready for review July 13, 2023 16:08
@@ -111,7 +111,7 @@ func (t *tree) commitWithHooks(
}

log = append(log, writelog.LogEntry{Key: entry.key, Value: entry.value})
if len(entry.value) == 0 {
if entry.value == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the rest of the code, if the value is nil then so is the insertedLeaf (not true the other way around). So this code could actually be simplified to:

logAnns = append(logAnns, writelog.LogEntryAnnotation{InsertedNode: entry.insertedLeaf})

@kostko kostko merged commit eddc88b into master Jul 14, 2023
3 checks passed
@kostko kostko deleted the kostko/fix/mkvs-writelog-empty branch July 14, 2023 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants