-
Notifications
You must be signed in to change notification settings - Fork 56
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
Why doesn't arena have a way to iterate over nodeids? #105
Comments
I'm not sure what exactly your code is trying to do, but you can filter nodes by id using something like this: arena
.iter()
.map(|node| arena.get_node_id(node).expect("conversion infallible for iteration"))
.filter(|node_id| my_cool_filter_function(node_id));
|
i do
Seeing as i'm never gonna remove nodes in my specific code. But my point is, the way to traverse ids should be there already. If you just iter -> map -> getnodeid, that method should be in the library. I, the user, do not know by default that this is cheap, and i should not even concern myself with this, as iterating over the keys/values is a very common case for a container. I initially expected arena.iter() to give you pairs. |
Yeah, it'd be nice to have |
How am i supposed to filter some ids from arena, for further manipulations? get_node_id searches the entire arena.
Also, how are you supposed to do memoized recursion
can't pass arena to to a method, if you're invoking it on something inside arena.
The text was updated successfully, but these errors were encountered: