mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Simplify Tap#alias_table
.
This commit is contained in:
parent
8d4e841965
commit
0592f7ac07
@ -150,7 +150,6 @@ class Tap
|
||||
@full_name = "#{@user}/homebrew-#{@repo}"
|
||||
@path = TAP_DIRECTORY/@full_name.downcase
|
||||
@git_repo = GitRepository.new(@path)
|
||||
@alias_table = nil
|
||||
@alias_reverse_table = nil
|
||||
end
|
||||
|
||||
@ -715,17 +714,14 @@ class Tap
|
||||
@aliases ||= alias_table.keys
|
||||
end
|
||||
|
||||
# a table mapping alias to formula name
|
||||
# Mapping from aliases to formula names.
|
||||
#
|
||||
# @private
|
||||
sig { returns(T::Hash[String, String]) }
|
||||
def alias_table
|
||||
return @alias_table if @alias_table
|
||||
|
||||
@alias_table = {}
|
||||
alias_files.each do |alias_file|
|
||||
@alias_table[alias_file_to_name(alias_file)] = formula_file_to_name(alias_file.resolved_path)
|
||||
@alias_table ||= alias_files.each_with_object({}) do |alias_file, alias_table|
|
||||
alias_table[alias_file_to_name(alias_file)] = formula_file_to_name(alias_file.resolved_path)
|
||||
end
|
||||
@alias_table
|
||||
end
|
||||
|
||||
# a table mapping formula name to aliases
|
||||
|
Loading…
x
Reference in New Issue
Block a user