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

Fix AroundBlockScan #131

Merged
merged 6 commits into from
Jan 20, 2022
Merged

Fix AroundBlockScan #131

merged 6 commits into from
Jan 20, 2022

Conversation

schneems
Copy link
Collaborator

Previously we were accidentally not using the persisted @before_index and instead using the "original" before index. This commit fixes that problem and adds a test for the behavior.

Previously we were accidentally not using the persisted @before_index and instead using the "original" before index. This commit fixes that problem and adds a test for the behavior.
@schneems schneems force-pushed the schneems/fix-around-block-before-index branch from 289cb0c to ad8b2bd Compare January 20, 2022 02:14
When scanning returns nothing, the block position should not change.
This refactor removes the need to allocate an extra AroundBlockScan. Not a big hotspot, but it's not needed either.
Calling `send` and iterating over an array is not great. We're only dealing with 2 cases, we can explicitly handle both of them.
We're already skipping `hidden?` we don't need to call the method again.
Experimenting with this approach (not a hotspot).
@schneems schneems force-pushed the schneems/fix-around-block-before-index branch from 084bf6f to b579f5f Compare January 20, 2022 02:58
@schneems schneems merged commit 89c6882 into main Jan 20, 2022
@schneems schneems deleted the schneems/fix-around-block-before-index branch January 20, 2022 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant