From a8566c9848122474b92fc8989eec196d5f4fb69b Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Fri, 5 Aug 2016 22:01:32 +0800 Subject: 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)).--- Library/Homebrew/software_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library/Homebrew/software_spec.rb') diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 909819c33..10b6221de 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -77,7 +77,7 @@ class SoftwareSpec end def bottle_defined? - bottle_specification.collector.keys.any? + !bottle_specification.collector.keys.empty? end def bottled? -- cgit v1.2.3