Skip to content
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

require List::Util 1.50 and delegate for head and tail #1394

Closed
wants to merge 1 commit into from

Conversation

Grinnz
Copy link
Contributor

@Grinnz Grinnz commented Jul 31, 2019

Summary

Delegate to the head and tail functions from List::Util 1.50.

Note that this raises the minimum Perl version that fatpacked Mojolicious will work on from 5.22 to 5.28, as List::Util cannot be fatpacked.

Motivation

Code cleanliness and efficiency.

References

#1360

@Grinnz
Copy link
Contributor Author

Grinnz commented Jul 31, 2019

An alternative is to delegate only if List::Util 1.50 is available, which retains the performance benefit if any on newer perls, but adds more code.

@Grinnz
Copy link
Contributor Author

Grinnz commented Jul 31, 2019

I am closing this as I cannot find a set of data where delegating to List::Util outperforms the resulting sub call overhead.

@Grinnz Grinnz closed this Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant