diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-11-14 17:44:02 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-11-14 17:44:02 -0800 |
commit | 8057c9584af44da07fdd7a8b37ac08cc79d9773c (patch) | |
tree | e4b27e29b164071e41214bf5d63b05107bec970f /lib/unicorn/app/old_rails/static.rb | |
parent | 5663773f053a0cd9764e43b9f34b341f6df5853f (diff) | |
download | unicorn-8057c9584af44da07fdd7a8b37ac08cc79d9773c.tar.gz |
No need to freeze them unless we're assigning new hash values (PATH_INFO is already hashed when we assign it).
Diffstat (limited to 'lib/unicorn/app/old_rails/static.rb')
-rw-r--r-- | lib/unicorn/app/old_rails/static.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/unicorn/app/old_rails/static.rb b/lib/unicorn/app/old_rails/static.rb index 1a78a23..82f8aa5 100644 --- a/lib/unicorn/app/old_rails/static.rb +++ b/lib/unicorn/app/old_rails/static.rb @@ -21,9 +21,11 @@ # fast as if you use a static server like nginx). class Unicorn::App::OldRails::Static < Struct.new(:app, :root, :file_server) FILE_METHODS = { 'GET' => true, 'HEAD' => true } - REQUEST_METHOD = 'REQUEST_METHOD'.freeze - REQUEST_URI = 'REQUEST_URI'.freeze - PATH_INFO = 'PATH_INFO'.freeze + + # avoid allocating new strings for hash lookups + REQUEST_METHOD = 'REQUEST_METHOD' + REQUEST_URI = 'REQUEST_URI' + PATH_INFO = 'PATH_INFO' def initialize(app) self.app = app |