Simplify hash merge.

This commit is contained in:
Markus Reiter 2023-05-05 01:26:59 +02:00
parent b0dc84b117
commit 023238a761
No known key found for this signature in database
GPG Key ID: 245293B51702655B

View File

@ -2239,12 +2239,9 @@ class Formula
# Take from API, merging in local install status.
if self.class.loaded_from_api && !Homebrew::EnvConfig.no_install_from_api?
json_formula = Homebrew::API::Formula.all_formulae[name].dup
json_formula["name"] = hash["name"]
json_formula["installed"] = hash["installed"]
json_formula["linked_keg"] = hash["linked_keg"]
json_formula["pinned"] = hash["pinned"]
json_formula["outdated"] = hash["outdated"]
return json_formula
return json_formula.merge(
hash.slice("name", "installed", "linked_keg", "pinned", "outdated"),
)
end
variations = {}