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

Stash array of numbers in a private constant #621

merged 1 commit into from Jul 16, 2019


Copy link

@ashmaroli ashmaroli commented Jul 14, 2019

This is to reduce allocation of (0..128).to_a in applicable situations.

2/3 of the conditional in #convert_ul in the HTML converter invokes a new array (0..128).to_a which is subsequently duplicated via Array#map. This can be optimized by instead using a constant array of integers which are then duped as required.

@gettalong gettalong merged commit cfd80ac into gettalong:master Jul 16, 2019
1 check passed
Copy link

@gettalong gettalong commented Jul 16, 2019


@ashmaroli ashmaroli deleted the zero-till-one-twenty-eight branch Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants