aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMau Magnaguagno <maumagnaguagno@gmail.com>2023-11-30 00:24:44 -0300
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-12-05 14:28:39 +0900
commit5f789350dceef80494e4e3e3e1ce95f886657845 (patch)
tree8f0f1f375ae502207e13b69160de16c463a0b960 /lib
parenta3cd7b3e27506f0b60a05292db8a18de520c69a6 (diff)
downloadruby-5f789350dceef80494e4e3e3e1ce95f886657845.tar.gz
[rubygems/rubygems] Prefer String#split with block in Bundler::CompactIndexClient::Cache#versions
String#split supports a block since Ruby 2.6, avoiding intermediate array. https://github.com/rubygems/rubygems/commit/4e864a8f2e
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/compact_index_client/cache.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler/compact_index_client/cache.rb b/lib/bundler/compact_index_client/cache.rb
index 5efdf18eba..55911fdecf 100644
--- a/lib/bundler/compact_index_client/cache.rb
+++ b/lib/bundler/compact_index_client/cache.rb
@@ -32,7 +32,7 @@ module Bundler
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