Skip to content

Stash array of numbers in a private constant#621

Merged
gettalong merged 1 commit into
gettalong:masterfrom
ashmaroli:zero-till-one-twenty-eight
Jul 16, 2019
Merged

Stash array of numbers in a private constant#621
gettalong merged 1 commit into
gettalong:masterfrom
ashmaroli:zero-till-one-twenty-eight

Conversation

@ashmaroli
Copy link
Copy Markdown
Contributor

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
@gettalong
Copy link
Copy Markdown
Owner

Thanks!

@ashmaroli ashmaroli deleted the zero-till-one-twenty-eight branch July 17, 2019 06:28
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.

2 participants