Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use more distinct and faster form of Hash casting

  • Loading branch information...
commit cbe9d572b508afd4d3eadfd007aab48127b05501 1 parent 4c58e4d
@brainopia brainopia authored
View
2  lib/rack/handler/mongrel.rb
@@ -53,7 +53,7 @@ def initialize(app)
end
def process(request, response)
- env = {}.replace(request.params)
+ env = Hash[request.params]
env.delete "HTTP_CONTENT_TYPE"
env.delete "HTTP_CONTENT_LENGTH"
View
2  lib/rack/handler/scgi.rb
@@ -29,7 +29,7 @@ def initialize(settings = {})
end
def process_request(request, input_body, socket)
- env = {}.replace(request)
+ env = Hash[request]
env.delete "HTTP_CONTENT_TYPE"
env.delete "HTTP_CONTENT_LENGTH"
env["REQUEST_PATH"], env["QUERY_STRING"] = env["REQUEST_URI"].split('?', 2)
View
2  lib/rack/session/abstract/id.rb
@@ -79,7 +79,7 @@ def clear
def to_hash
load_for_read!
- h = {}.replace(self)
+ h = Hash[self]
h.delete_if { |k,v| v.nil? }
h
end
Please sign in to comment.
Something went wrong with that request. Please try again.