aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2014-03-26 16:07:49 -0500
committerJack Nagel2014-03-26 16:07:49 -0500
commit4fe0be37c0311c24aa2df6287dabb7505b587f27 (patch)
tree6d42646b467ac9d1d1b0fdb4c2259466737d239d /Library/Homebrew
parent91d31ae1f43cade6fac808b6042133c328638274 (diff)
downloadbrew-4fe0be37c0311c24aa2df6287dabb7505b587f27.tar.bz2
Drop intermediate variable
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/utils/inreplace.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/Library/Homebrew/utils/inreplace.rb b/Library/Homebrew/utils/inreplace.rb
index 287058021..4fa2fbe7c 100644
--- a/Library/Homebrew/utils/inreplace.rb
+++ b/Library/Homebrew/utils/inreplace.rb
@@ -10,8 +10,7 @@ module Utils
yield s
else
after = after.to_s if Symbol === after
- sub = s.gsub!(before, after)
- if sub.nil?
+ unless s.gsub!(before, after)
message = <<-EOS.undent
inreplace in '#{path}' failed
Expected replacement of '#{before}' with '#{after}'