-
Notifications
You must be signed in to change notification settings - Fork 349
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
revset: remove 'index lifetime from InternalRevset #2700
Conversation
The idea is that InternalRevset will store a 'static boilerplate function that borrows an 'index passed by function argument. This way, we can abstract the index type over Arc<T> and &T without introducing too much generics.
This adds overhead to re-look up IndexEntry, but I don't think that would have significant impact on performance.
The returned iterator is boxed by caller due to the limitation of the type system. There's a workaround, but it's super ugly. https://users.rust-lang.org/t/hrtb-on-multiple-generics/34255/3
Also renamed the boxed version to discriminate it from the cast helper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really against this, but it's not an obvious simplification (many added lines of code, but perhaps easier to reason about?), so I'm curious what the goal is. Will it allow some improvements that would be hard to do with the current design?
The goal is to remove main...yuja:jj:push-ntksqqnrwqpy We can also rewrite RevWalk, etc. to hold |
Oh, that seems nice. Thanks for working on that. I've already reviewed this PR, so I'll go and approve it now. |
And the last bits to remove Thanks for reviewing! |
Checklist
If applicable:
CHANGELOG.md