You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fold and rfold are APIs for internal iteration, which is sometimes more efficient than external iteration (next and next_back). It is always possible to implement internal iteration in terms of external, which is what the default impl does, but this implementation need not be optimal. Flatten (which roaring uses) has more efficient fold and rfold implementations than the default. Roaring should use the implementations from Flatten rather than the default implementations.
Ideally you would implement try_fold and try_rfold as well, but they cannot be implemented until the Try trait is stabilized (rust-lang/rust#84277).
This might apply to other default implementations overridden by Flatten as well.
The text was updated successfully, but these errors were encountered:
Thank you for the information and proposal. It is very interesting. Would you mind doing a PR or something at some point? Or is it more like a tracking issue?
fold
andrfold
are APIs for internal iteration, which is sometimes more efficient than external iteration (next
andnext_back
). It is always possible to implement internal iteration in terms of external, which is what the default impl does, but this implementation need not be optimal.Flatten
(which roaring uses) has more efficientfold
andrfold
implementations than the default. Roaring should use the implementations fromFlatten
rather than the default implementations.Ideally you would implement
try_fold
andtry_rfold
as well, but they cannot be implemented until theTry
trait is stabilized (rust-lang/rust#84277).This might apply to other default implementations overridden by
Flatten
as well.The text was updated successfully, but these errors were encountered: