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

Discrepancies in Comments #3419

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

dmytroheknt
Copy link

There's a mismatch in the second doc comment: it references find_keys_by_prefix
but the function is actually named find_key_values_by_prefix.
Also, the top comment mentions generating about 2000 keys of length 11,
whereas the code sets NUM_ENTRIES to 200 and LEN_KEY to 10.

Signed-off-by: dmytroheknt <[email protected]>
@@ -12,7 +12,7 @@ use crate::{
test_utils::{add_prefix, get_random_key_values2},
};

// We generate about 2000 keys of length 11 with a key of length 10000
// We generate about 200 keys of length 10 with a value of length 10000
Copy link
Contributor

@MathieuDutSik MathieuDutSik Mar 3, 2025

Choose a reason for hiding this comment

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

You are correct about the 2000 -> 200.

About the key length, you are wrong:

  • The keys generated by get_random_key_values2 are of length 11: There is a key_prefix of length 1 and an additional randomly generated key of length 10.
  • The add_prefix is adding a [0]. The length of the keys is thus 12.

So, I think the right PR is to keep the length of length 11 and remove the add_prefix. We only need a prefix [0] not the overkill [0, 0].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants