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
add a Base.tail
method for nonempty tuples
#52035
base: master
Are you sure you want to change the base?
Conversation
If this is good to go, perhaps it would also make sense to reimplement |
Base.tail
Base.tail
method for nonempty tuples
Not that I am an expert at all, but would not using |
The
|
I have some code that sorts tuples using recursion. When the tuple length gets big (over around 65), suddenly I get lots of allocations in my code, when there should be none. Using `@profview_allocs` shows that the allocations happen in `Base.tail`. This simple implementation fixes that.
Indentation fixed (four spaces). |
Would be good to get a review and merge. |
Perhaps some testing, and a comment or two about why it's written that way? |
Should the (The empty tuple case is of course handled by the |
Seems like something like |
I have some code that sorts tuples using recursion. When the tuple length gets big (over around 65), suddenly I get lots of allocations in my code, when there should be none. Using
@profview_allocs
shows that the allocations happen inBase.tail
. This simple implementation fixes that.