Permalink
Browse files

using a merge with a Hash[] rather than a loop to add SAX parsed attr…

…ibutes
  • Loading branch information...
1 parent 437ceab commit 254b0a4bbb5e21fe3c48ac826caec025fcaeffb5 @tenderlove tenderlove committed Nov 16, 2010
Showing with 2 additions and 3 deletions.
  1. +1 −1 Gemfile
  2. +1 −2 activesupport/lib/active_support/xml_mini/nokogirisax.rb
View
@@ -39,7 +39,7 @@ end
platforms :ruby do
gem 'json'
gem 'yajl-ruby'
- gem "nokogiri", ">= 1.4.3.1"
+ gem "nokogiri", ">= 1.4.4"
# AR
gem "sqlite3-ruby", "~> 1.3.1", :require => 'sqlite3'
@@ -38,8 +38,7 @@ def error(error_message)
end
def start_element(name, attrs = [])
- new_hash = { CONTENT_KEY => '' }
- new_hash[attrs.shift] = attrs.shift while attrs.length > 0
+ new_hash = { CONTENT_KEY => '' }.merge(Hash[attrs])
new_hash[HASH_SIZE_KEY] = new_hash.size + 1
case current_hash[name]

0 comments on commit 254b0a4

Please sign in to comment.