Skip to content

Prefer String#each_line in Net::FTP#features#28

Merged
shugo merged 1 commit into
ruby:masterfrom
Maumagnaguagno:each_line_in_features
Jun 1, 2024
Merged

Prefer String#each_line in Net::FTP#features#28
shugo merged 1 commit into
ruby:masterfrom
Maumagnaguagno:each_line_in_features

Conversation

@Maumagnaguagno

Copy link
Copy Markdown
Contributor

String#split without a block creates an intermediate array and requires a call to Array#each to iterate.
Replace String#split("\n").each with String#each_line, which is more efficient and readable.

Replace ``String#split("\n").each`` with ``String#each_line``.
@shugo
shugo merged commit a711ae5 into ruby:master Jun 1, 2024
@shugo

shugo commented Jun 1, 2024

Copy link
Copy Markdown
Member

It looks good. Thank you!

@Maumagnaguagno
Maumagnaguagno deleted the each_line_in_features branch June 1, 2024 17:57
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