Skip to content

Commit

Permalink
Chef::CookbookSynchronizer#remove_deleted_files: Use Arrays instead o…
Browse files Browse the repository at this point in the history
…f Sets

Should address #13940

Signed-off-by: David Crosby <dcrosby@fb.com>
  • Loading branch information
dafyddcrosby committed Sep 22, 2023
1 parent 3995905 commit d93bd7d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/chef/cookbook/synchronizer.rb
Expand Up @@ -18,7 +18,6 @@
require_relative "../server_api"
require "singleton" unless defined?(Singleton)
require "chef-utils/dist" unless defined?(ChefUtils::Dist)
require "set" unless defined?(Set)

class Chef

Expand Down Expand Up @@ -240,8 +239,8 @@ def remove_deleted_files
@cookbooks_by_name.each_key do |cookbook_name|
cache_file_hash[cookbook_name].each_key do |segment|
manifest_segment = cookbook_segment(cookbook_name, segment)
manifest_record_paths = manifest_segment.map { |manifest_record| manifest_record["path"] }.to_set
to_be_removed = cache_file_hash[cookbook_name][segment].keys.to_set - manifest_record_paths
manifest_record_paths = manifest_segment.map { |manifest_record| manifest_record["path"] }
to_be_removed = cache_file_hash[cookbook_name][segment].keys - manifest_record_paths
to_be_removed.each do |path|
cache_file = cache_file_hash[cookbook_name][segment][path]

Expand Down

0 comments on commit d93bd7d

Please sign in to comment.