From 2bc40ff385c2fecea1e26230a8c6e8121bc66bae Mon Sep 17 00:00:00 2001
From: Jack Nagel <jacknagel@gmail.com>
Date: Thu, 25 Jun 2015 19:33:47 -0400
Subject: [PATCH] Pull complex condition out of loop

---
 Library/Homebrew/cmd/outdated.rb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Library/Homebrew/cmd/outdated.rb b/Library/Homebrew/cmd/outdated.rb
index 10fa369533..b86e0a2813 100644
--- a/Library/Homebrew/cmd/outdated.rb
+++ b/Library/Homebrew/cmd/outdated.rb
@@ -39,8 +39,10 @@ module Homebrew
   end
 
   def print_outdated
+    verbose = ($stdout.tty? || ARGV.verbose?) && !ARGV.flag?("--quiet")
+
     outdated_brews(formulae_to_check) do |f, versions|
-      if ($stdout.tty? || ARGV.verbose?) && !ARGV.flag?("--quiet")
+      if verbose
         puts "#{f.full_name} (#{versions*', '} < #{f.pkg_version})"
       else
         puts f.full_name
-- 
GitLab