-
Notifications
You must be signed in to change notification settings - Fork 126
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
Use Vec::drain_filter when available #522
Comments
ftr, I solve a similar problem with the combination of drain.filter_map.collect, moving the removed elements to a separate vec (or consuming in other ways) in the filter_map callback |
@martinthomson this is now neqo/neqo-qpack/src/decoder.rs Lines 93 to 98 in 32ef2c3
Anything left to do? |
This would be better with drain_filter(), but what we have is fine. Given that drain_filter is taking SOOOO long to stablize, we might just give up on it. |
This code has bothered me for a while, because it seems inefficient (two inverse filters means redundancy). It's better than dumb iteration, but it isn't perfect.
neqo/neqo-qpack/src/decoder.rs
Lines 68 to 75 in 44dfdbf
Turns out that
Vec::drain_filter
is coming. When that becomes stable, we should move to using that.drain_filter(|i| {/* logic here */}).collect()
will be much nicer.The text was updated successfully, but these errors were encountered: