Merge pull request #15418 from reitermarkus/simplify-hash-merge

Simplify hash merge.
This commit is contained in:
Markus Reiter 2023-05-14 21:41:39 +02:00 committed by GitHub
commit 94d6213196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2240,12 +2240,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 = {}