From 08e35e9cb4e65c6969016ffaa8af4e1a968ca496 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Thu, 30 Jul 2020 03:24:37 +0200 Subject: [PATCH] Refactor `FormulaLoader#get_formula`. --- Library/Homebrew/formulary.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 65ca197f4e..a812e589c9 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -124,8 +124,8 @@ module Formulary # `alias_path` can be overridden here in case an alias was used to refer to # a formula that was loaded in another way. def get_formula(spec, alias_path: nil, force_bottle: false, flags: []) - klass(flags: flags) - .new(name, path, spec, alias_path: alias_path || self.alias_path, force_bottle: force_bottle) + alias_path ||= self.alias_path + klass(flags: flags).new(name, path, spec, alias_path: alias_path, force_bottle: force_bottle) end def klass(flags:)