Skip to content

Commit

Permalink
[rubygems/rubygems] Prefer String#split with block in Bundler::Compac…
Browse files Browse the repository at this point in the history
…tIndexClient::Cache#versions

String#split supports a block since Ruby 2.6, avoiding intermediate array.

rubygems/rubygems@4e864a8f2e
  • Loading branch information
Maumagnaguagno authored and hsbt committed Dec 5, 2023
1 parent a3cd7b3 commit 5f78935
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bundler/compact_index_client/cache.rb
Expand Up @@ -32,7 +32,7 @@ def versions
lines(versions_path).each do |line|
name, versions_string, info_checksum = line.split(" ", 3)
info_checksums_by_name[name] = info_checksum || ""
versions_string.split(",").each do |version|
versions_string.split(",") do |version|
delete = version.delete_prefix!("-")
version = version.split("-", 2).unshift(name)
if delete
Expand Down

0 comments on commit 5f78935

Please sign in to comment.