From 0758631d3db05338f79aa675a963891eafcf50db Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Mon, 28 Mar 2022 21:41:40 +0900 Subject: [PATCH] remove if condition --- Library/Homebrew/extend/os/mac/search.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/extend/os/mac/search.rb b/Library/Homebrew/extend/os/mac/search.rb index 76763251f4..5ead324149 100644 --- a/Library/Homebrew/extend/os/mac/search.rb +++ b/Library/Homebrew/extend/os/mac/search.rb @@ -36,10 +36,9 @@ module Homebrew results = cask_tokens.extend(Searchable) .search(string_or_regex) - if results.empty? - cask_names = Cask::Cask.all.map(&:full_name) - results = DidYouMean::SpellChecker.new(dictionary: cask_names).correct(string_or_regex) - end + cask_names = Cask::Cask.all.map(&:full_name) + results |= DidYouMean::SpellChecker.new(dictionary: cask_names) + .correct(string_or_regex) results.sort.map do |name| cask = Cask::CaskLoader.load(name) @@ -48,7 +47,7 @@ module Homebrew else cask.token end - end + end.uniq end end