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

get_next and get_prev on OrdMap/Set don't appear to work beyond a single node #215

Open
rphmeier opened this issue Nov 1, 2024 · 0 comments · May be fixed by #216
Open

get_next and get_prev on OrdMap/Set don't appear to work beyond a single node #215

rphmeier opened this issue Nov 1, 2024 · 0 comments · May be fixed by #216

Comments

@rphmeier
Copy link

rphmeier commented Nov 1, 2024

Here's a minimal reproduction:

    let COUNT: usize = 65;

    let mut values = (0..65).map(|i| (i + 1) * 2).collect::<Vec<_>>();

    let set = values.iter().cloned().collect::<im::ordset::OrdSet<usize>>();
    for value in &values {
        let next = *value + 1;
        assert_eq!(set.get_prev(&next), Some(value));

        let prev = *value - 1;
        assert_eq!(set.get_next(&prev), Some(value));
    } 

Note that if you set count to 64 or less, this works.

@rphmeier rphmeier linked a pull request Nov 1, 2024 that will close this issue
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 a pull request may close this issue.

1 participant