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

chore(trie): remove PrefixSetMut::contains #10466

Merged
merged 5 commits into from
Aug 23, 2024

Conversation

rkrasiuk
Copy link
Member

Description

Remove PrefixSetMut::contains given that this is a mutable collection not intended for searching.

@rkrasiuk rkrasiuk added C-enhancement New feature or request A-trie Related to Merkle Patricia Trie implementation labels Aug 22, 2024
@rkrasiuk rkrasiuk requested a review from Rjected as a code owner August 22, 2024 19:10
/// assert!(prefix_set.contains(&[0xa, 0xb]));
/// assert!(prefix_set.contains(&[0xa, 0xb, 0xc]));
/// ```
#[derive(Clone, Default, Debug)]
pub struct PrefixSetMut {
keys: Vec<Nibbles>,
sorted: bool,
Copy link
Member Author

Choose a reason for hiding this comment

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

should always be treated as unsorted

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

don't love the Abstraction suffix, be looks like we already use this this for PrefixSet

use std::collections::BTreeSet;

pub trait PrefixSetMutAbstraction: Default {
Copy link
Collaborator

Choose a reason for hiding this comment

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

needs docs

@rkrasiuk
Copy link
Member Author

rkrasiuk commented Aug 23, 2024

@mattsse doesn't matter really since this is used only for benching

@rkrasiuk rkrasiuk requested a review from mattsse August 23, 2024 03:48
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

gotcha

@rkrasiuk rkrasiuk added this pull request to the merge queue Aug 23, 2024
Merged via the queue into main with commit 72293c9 Aug 23, 2024
34 checks passed
@rkrasiuk rkrasiuk deleted the rkrasiuk/remove-prefix-set-mut-contains branch August 23, 2024 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trie Related to Merkle Patricia Trie implementation C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants