-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
feat: improve the lifetime of as_ast_kind methods #5506
Comments
You are right, |
We don't need to consume itself, just adding the lifetime is enough. |
I am ok for both, but |
Oh, I just saw this comment, Please ignore my comment on the merged PR. I was thinking that since both the |
Yes Sir, Since the naming is an anti-pattern this might not be worth doing. Please go ahead and implement it as you see fit. |
ok, that make sence. |
performance goes first, |
@IWANABETHATGUY No I'm sorry, I was hullucinating. The Please ignore everything I said above. |
Out of interest, is your "is more performant" conclusion based on measurement? I would tend to always make methods on But maybe I'm wrong. If I am, I would very much like to know! Most of |
No Sir, But since it is bigger than a pointer it isn't an open-and-shut case anymore and indirection may or may not be faster. I could've used better wording there. |
Thanks for coming back. Hmm I wonder which is more performant. Probably (hopefully) these tiny functions will all get inlined anyway, so it'll make no difference in practice. But it'd be useful to know for other cases. |
I tried to introduce new methods in PR #5491 , but encountered:
to
error:
When I changed the method to the following, there was no longer this problem.
@IWANABETHATGUY cc
The text was updated successfully, but these errors were encountered: