From 84b2276fd866342cd84c6ada8ffc13c5c209c3cf Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 24 Oct 2016 17:07:57 +0200 Subject: Use guard clauses. --- Library/Homebrew/cask/lib/hbc/cli/search.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Library/Homebrew/cask/lib/hbc/cli') diff --git a/Library/Homebrew/cask/lib/hbc/cli/search.rb b/Library/Homebrew/cask/lib/hbc/cli/search.rb index 8e8f8fd75..3f73fcd2e 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/search.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/search.rb @@ -41,14 +41,15 @@ module Hbc ohai "Exact match" puts exact_match end - unless partial_matches.empty? - if extract_regexp search_term - ohai "Regexp matches" - else - ohai "Partial matches" - end - puts Formatter.columns(partial_matches) + + return if partial_matches.empty? + + if extract_regexp search_term + ohai "Regexp matches" + else + ohai "Partial matches" end + puts Formatter.columns(partial_matches) end def self.help -- cgit v1.2.3