diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2012-01-29 11:30:37 -0800 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2012-01-29 11:30:37 -0800 |
commit | dfa0c36204beb1b519962a6a49a1ebbed91015dd (patch) | |
tree | 2794ed0b8dd33458d2509ddd974519df9f561c8b /activesupport | |
parent | 677e06c20f6df6c44f44af9ba95390558e67a9bc (diff) | |
parent | bf928bc7329640969917eb680da4de959b7156b7 (diff) | |
download | rails-dfa0c36204beb1b519962a6a49a1ebbed91015dd.tar.gz rails-dfa0c36204beb1b519962a6a49a1ebbed91015dd.tar.bz2 rails-dfa0c36204beb1b519962a6a49a1ebbed91015dd.zip |
Merge pull request #4744 from ndbroadbent/replace_for_loops_with_enumerables
Replaced all 'for' loops with Enumerable#each
Diffstat (limited to 'activesupport')
-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 |