diff options
author | Nathan Broadbent <nathan.f77@gmail.com> | 2012-01-30 00:54:17 +0800 |
---|---|---|
committer | Nathan Broadbent <nathan.f77@gmail.com> | 2012-01-30 03:15:49 +0800 |
commit | b31eac56097a0bfc5f5af70de91ad261067a395f (patch) | |
tree | 940fc90f5132122e70e49cb670776f32af41bde9 /activesupport/lib | |
parent | ec4440fd4e886bc491726070b9fc44938f8798ee (diff) | |
download | rails-b31eac56097a0bfc5f5af70de91ad261067a395f.tar.gz rails-b31eac56097a0bfc5f5af70de91ad261067a395f.tar.bz2 rails-b31eac56097a0bfc5f5af70de91ad261067a395f.zip |
Replaced all 'for' loops with Enumerable#each
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/xml_mini/jdom.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/xml_mini/jdom.rb b/activesupport/lib/active_support/xml_mini/jdom.rb index 6c222b83ba..dbb6c71907 100644 --- a/activesupport/lib/active_support/xml_mini/jdom.rb +++ b/activesupport/lib/active_support/xml_mini/jdom.rb @@ -71,7 +71,7 @@ module ActiveSupport child_nodes = element.child_nodes if child_nodes.length > 0 - for i in 0...child_nodes.length + (0...child_nodes.length).each do |i| child = child_nodes.item(i) merge_element!(hash, child) unless child.node_type == Node.TEXT_NODE end @@ -133,7 +133,7 @@ module ActiveSupport def get_attributes(element) attribute_hash = {} attributes = element.attributes - for i in 0...attributes.length + (0...attributes.length).each do |i| attribute_hash[CONTENT_KEY] ||= '' attribute_hash[attributes.item(i).name] = attributes.item(i).value end @@ -147,7 +147,7 @@ module ActiveSupport def texts(element) texts = [] child_nodes = element.child_nodes - for i in 0...child_nodes.length + (0...child_nodes.length).each do |i| item = child_nodes.item(i) if item.node_type == Node.TEXT_NODE texts << item.get_data @@ -163,7 +163,7 @@ module ActiveSupport def empty_content?(element) text = '' child_nodes = element.child_nodes - for i in 0...child_nodes.length + (0...child_nodes.length).each do |i| item = child_nodes.item(i) if item.node_type == Node.TEXT_NODE text << item.get_data.strip |