Permalink
Browse files

Use Hash#to_a instead of Hash#entries for minor speed increase

At least on rubinius, Hash#to_a is much faster.
  • Loading branch information...
1 parent 9946127 commit d1ea2659b0afa1a5a5887ad1d9d3b5f8e9b8b21b @jeremyevans committed Mar 21, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/sequel/database/connecting.rb
@@ -54,7 +54,7 @@ def self.connect(conn_string, opts = {})
c = adapter_class(scheme)
uri_options = c.send(:uri_to_options, uri)
uri.query.split('&').collect{|s| s.split('=')}.each{|k,v| uri_options[k.to_sym] = v if k && !k.empty?} unless uri.query.to_s.strip.empty?
- uri_options.entries.each{|k,v| uri_options[k] = URI.unescape(v) if v.is_a?(String)}
+ uri_options.to_a.each{|k,v| uri_options[k] = URI.unescape(v) if v.is_a?(String)}
opts = uri_options.merge(opts)
opts[:adapter] = scheme
end

0 comments on commit d1ea265

Please sign in to comment.