From d31bee2e5b533cd09840768086dcaa463b02342e Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Fri, 21 Feb 2014 00:43:58 -0500 Subject: Avoid ancestors.include?, klass1 < klass2 is faster --- Library/Homebrew/formulary.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library') diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 350854bba..189160d54 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -65,7 +65,7 @@ class Formulary end klass = Formulary.get_formula_class(name) - if (klass == Formula) || !klass.ancestors.include?(Formula) + if klass == Formula || !(klass < Formula) raise FormulaUnavailableError.new(name) end klass -- cgit v1.2.3