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

Prefer String#unpack1 #586

Merged
merged 2 commits into from
Aug 31, 2023
Merged

Prefer String#unpack1 #586

merged 2 commits into from
Aug 31, 2023

Conversation

Maumagnaguagno
Copy link
Contributor

@Maumagnaguagno Maumagnaguagno commented Dec 27, 2022

String#unpack1 avoids the intermediate array created by String#unpack for single elements, while also making a call to Array#first/[0] unnecessary.

@hsbt
Copy link
Member

hsbt commented Dec 27, 2022

@Maumagnaguagno Can you describe why we should use it?

@Maumagnaguagno
Copy link
Contributor Author

@hsbt I filled the blank description in the top comment.

@Maumagnaguagno
Copy link
Contributor Author

Note that this PR is similar to previous commits within this organization, see ruby/ruby@5de6e25, ruby/securerandom@5460a18 and ruby/reline@179c52b.

@rhenium
Copy link
Member

rhenium commented Aug 31, 2023

Can you remove the diff in test/openssl/envutil.rb? This file has since been removed from the master branch.

@Maumagnaguagno
Copy link
Contributor Author

I reverted test/openssl/envutil.rb changes to remove the file from the diff.

@rhenium rhenium merged commit 8eb0715 into ruby:master Aug 31, 2023
@rhenium
Copy link
Member

rhenium commented Aug 31, 2023

Thank you!

@Maumagnaguagno Maumagnaguagno deleted the unpack1 branch August 31, 2023 16:43
matzbot pushed a commit to ruby/ruby that referenced this pull request Sep 6, 2023
(ruby/openssl#586)

String#unpack1 avoids the intermediate array created by String#unpack
for single elements, while also making a call to Array#first/[0]
unnecessary.

ruby/openssl@8eb0715a42
anakinj pushed a commit to anakinj/openssl that referenced this pull request Feb 17, 2024
String#unpack1 avoids the intermediate array created by String#unpack
for single elements, while also making a call to Array#first/[0]
unnecessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants