aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/exceptions.rb
diff options
context:
space:
mode:
authorXu Cheng2016-08-05 22:01:32 +0800
committerGitHub2016-08-05 22:01:32 +0800
commita8566c9848122474b92fc8989eec196d5f4fb69b (patch)
tree896c040fb575962be0aeb27bc9a99454f3514d73 /Library/Homebrew/exceptions.rb
parent38209aadbfe4fd0c6772467c4bc5c63325d53f6c (diff)
downloadbrew-a8566c9848122474b92fc8989eec196d5f4fb69b.tar.bz2
various: eliminate the usage of `any?` (#638)
`any?` is not the opposite of `empty?`. Besides the case that `[false, nil].any?` will return false, `any?`(O(n)) has much worse performance than `empty?`(O(1)).
Diffstat (limited to 'Library/Homebrew/exceptions.rb')
-rw-r--r--Library/Homebrew/exceptions.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb
index 6b839ca25..ba04a1d5a 100644
--- a/Library/Homebrew/exceptions.rb
+++ b/Library/Homebrew/exceptions.rb
@@ -350,7 +350,7 @@ class BuildError < RuntimeError
end
end
puts
- if RUBY_VERSION >= "1.8.7" && issues && issues.any?
+ if RUBY_VERSION >= "1.8.7" && issues && !issues.empty?
puts "These open issues may also help:"
puts issues.map { |i| "#{i["title"]} #{i["html_url"]}" }.join("\n")
end