aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/xml_mini/nokogiri.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-11-28 11:07:01 +0100
committerXavier Noria <fxn@hashref.com>2011-11-28 11:07:01 +0100
commit152bd3c510a735dfb493017ecb487e931e9791a8 (patch)
tree7d8f496cc3e6617ef71cab915cda7d419449f7d0 /activesupport/lib/active_support/xml_mini/nokogiri.rb
parentad5c8b0d5228c32355621162e1be211208ae3f5c (diff)
downloadrails-152bd3c510a735dfb493017ecb487e931e9791a8.tar.gz
rails-152bd3c510a735dfb493017ecb487e931e9791a8.tar.bz2
rails-152bd3c510a735dfb493017ecb487e931e9791a8.zip
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.
Diffstat (limited to 'activesupport/lib/active_support/xml_mini/nokogiri.rb')
-rw-r--r--activesupport/lib/active_support/xml_mini/nokogiri.rb2
1 files changed, 1 insertions, 1 deletions
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