From 152bd3c510a735dfb493017ecb487e931e9791a8 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Mon, 28 Nov 2011 11:07:01 +0100 Subject: Revert "Used any? instead of length call" Reason: This is slower, and any? is not equivalent in the general case. See discussion in https://github.com/rails/rails/pull/3779 This reverts commit 20cbf8eddc3844126d20f1218f068889d17b0dcf. --- activesupport/lib/active_support/xml_mini/nokogiri.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/xml_mini/nokogiri.rb') diff --git a/activesupport/lib/active_support/xml_mini/nokogiri.rb b/activesupport/lib/active_support/xml_mini/nokogiri.rb index fb539e9c88..04ec9e8ab8 100644 --- a/activesupport/lib/active_support/xml_mini/nokogiri.rb +++ b/activesupport/lib/active_support/xml_mini/nokogiri.rb @@ -26,7 +26,7 @@ module ActiveSupport else data.ungetc(char) doc = Nokogiri::XML(data) - raise doc.errors.first if doc.errors.any? + raise doc.errors.first if doc.errors.length > 0 doc.to_hash end end -- cgit v1.2.3