From 58e36c73193befb57d351344cea2a4a33fef850d Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 23 Sep 2016 22:02:23 +0200 Subject: Fix Style/GuardClause. --- Library/Homebrew/extend/string.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Library/Homebrew/extend/string.rb') diff --git a/Library/Homebrew/extend/string.rb b/Library/Homebrew/extend/string.rb index bd5994fe1..162666d2d 100644 --- a/Library/Homebrew/extend/string.rb +++ b/Library/Homebrew/extend/string.rb @@ -59,9 +59,8 @@ module StringInreplaceExtension # Looks for Makefile style variable defintions and replaces the # value with "new_value", or removes the definition entirely. def change_make_var!(flag, new_value) - unless gsub!(/^#{Regexp.escape(flag)}[ \t]*=[ \t]*(.*)$/, "#{flag}=#{new_value}", false) - errors << "expected to change #{flag.inspect} to #{new_value.inspect}" - end + return if gsub!(/^#{Regexp.escape(flag)}[ \t]*=[ \t]*(.*)$/, "#{flag}=#{new_value}", false) + errors << "expected to change #{flag.inspect} to #{new_value.inspect}" end # Removes variable assignments completely. -- cgit v1.2.3