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

Optimize check for key existence #18

Open
declanvk opened this issue Nov 17, 2022 · 0 comments
Open

Optimize check for key existence #18

declanvk opened this issue Nov 17, 2022 · 0 comments
Labels
optimization Optimization of existing features

Comments

@declanvk
Copy link
Owner

Currently the contains_key method is very simple:

    pub fn contains_key<K>(&self, k: K) -> bool
    where
        K: AsRef<[u8]>,
    {
        self.get(k).is_some()
    }

Possibly we could optimize this so that it doesn't return any extra information, but just fast returns if the key is present or missing. Needs specific benchmark results

@declanvk declanvk added the optimization Optimization of existing features label Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Optimization of existing features
Projects
None yet
Development

No branches or pull requests

1 participant