Skip to content

Conversation

danlaine
Copy link

Why this should be merged

We already use Maybe for end bounds so we should use them for start bounds for xonsistency.

How this works

Change []byte to maybe.Maybe[[]byte] for start bounds.

How this was tested

Update existing UT

@danlaine danlaine marked this pull request as ready for review August 17, 2023 16:25
heap.Fix(&wh.innerHeap, afterItem.heapIndex)
mergedAfter = afterItem
if item.localRootID == afterItem.workItem.localRootID {
if maybe.Equal(item.end, afterItem.workItem.start, bytes.Equal) {
Copy link
Contributor

Choose a reason for hiding this comment

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

reason to split the if?

Copy link
Author

Choose a reason for hiding this comment

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

Re-added && and removed second if

return m.value
}

func (m Maybe[T]) String() string {
Copy link
Contributor

Choose a reason for hiding this comment

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

was this used anywhere?

Copy link
Author

Choose a reason for hiding this comment

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

Yes in manager.go:

		zap.Stringer("start", work.start),
		zap.Stringer("end", largestHandledKey),

@danlaine danlaine merged commit 2bd58d1 into dev Aug 18, 2023
@danlaine danlaine deleted the maybe-start-bounds branch August 18, 2023 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants