Skip to content

Conversation

@jcmfernandes
Copy link
Contributor

String#ljust returns a new string, so whenever we need to add padding, we can replace "-/" in place with String#tr! and avoid creating yet another copy of the string. My benchmarks point to a 1.08-1.18x speedup.

I took the time to replace minitest with test-unit as it's the testing framework being used. Probably just an old unnoticed detail.

Maybe some long time ago this used minitest? That's not the case anymore.
String#ljust returns a new string, so whenever we need to add
padding, we can replace "-/" in place with String#tr! and avoid creating
yet another copy of the string.
@hsbt hsbt merged commit 00d889b into ruby:master Sep 25, 2021
@hsbt
Copy link
Member

hsbt commented Sep 25, 2021

Thanks.

I took the time to replace minitest with test-unit as it's the testing framework being used. Probably just an old unnoticed detail.

Also thanks to update this. I forgot to change it.

@jcmfernandes
Copy link
Contributor Author

Thanks.

I took the time to replace minitest with test-unit as it's the testing framework being used. Probably just an old unnoticed detail.

Also thanks to update this. I forgot to change it.

You're welcome! Thanks for the quick feedback. 🙌

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