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

Refactor iter_store_keys #2651

Conversation

MitchTurner
Copy link
Member

Description

Was looking into:

                // We have to clone the prefix and start, because we need to pass them to the iterator
                // if someone finds a solution without making it a vec, feel free to contribute :)
                let column = column.id();
                let prefix = prefix.map(|prefix| prefix.to_vec());
                let start = start.map(|start| start.to_vec());

and did some refactoring to get to the bottom of the problem.

I don't know if there is a solution unless we decide to change the signature of iter_store_keys to something like:

    fn iter_store_keys<'a>(
        &'a self,
        column: Self::Column,
        prefix: Option<&'a [u8]>,
        start: Option<&'a [u8]>,
        direction: IterDirection,
    ) -> BoxedIter<KeyItem>;

But that's not realistic in this PR.

Might as well keep the refactoring because I feel like it's cleaner.

@MitchTurner MitchTurner marked this pull request as ready for review January 29, 2025 23:40
@MitchTurner MitchTurner changed the title Refactor Refactor iter_store_keys Jan 29, 2025
@MitchTurner MitchTurner self-assigned this Jan 29, 2025
@MitchTurner MitchTurner added the no changelog Skip the CI check of the changelog modification label Jan 29, 2025
Copy link
Contributor

@AurelienFT AurelienFT left a comment

Choose a reason for hiding this comment

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

Thank you for that, yeah I'm sad we can't do better without breaking the trait but it's logic :/

@AurelienFT AurelienFT merged commit 1dfaa47 into take_vec_changes_rocksdb Jan 29, 2025
38 of 42 checks passed
@AurelienFT AurelienFT deleted the mitch/refactor_iter_store_keys/take_vec_changes_rocksdb branch January 29, 2025 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Skip the CI check of the changelog modification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants