about summary refs log tree commit
path: root/lib/metropolis/common/ro.rb
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2011-01-17 03:17:28 +0000
committerEric Wong <normalperson@yhbt.net>2011-01-17 09:18:31 +0000
commit2c913347a6e5cc8be776b14e1a177adec0fbd5b6 (patch)
tree8d001fa557ef23c66bc56aa6c2fba943e428382e /lib/metropolis/common/ro.rb
parent34a18520286313a05edc9a927ac4bed95b05191c (diff)
downloadmetropolis-2c913347a6e5cc8be776b14e1a177adec0fbd5b6.tar.gz
use constants everywhere to reduce GC thrashing
This makes it easier to notice a typo, too.
Diffstat (limited to 'lib/metropolis/common/ro.rb')
-rw-r--r--lib/metropolis/common/ro.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/metropolis/common/ro.rb b/lib/metropolis/common/ro.rb
index 390e2c6..c6015df 100644
--- a/lib/metropolis/common/ro.rb
+++ b/lib/metropolis/common/ro.rb
@@ -1,9 +1,11 @@
 # -*- encoding: binary -*-
 module Metropolis::Common::RO
+  include Metropolis::Constants
+
   def call(env)
-    if %r{\A/(.*)\z} =~ env["PATH_INFO"]
+    if %r{\A/(.*)\z} =~ env[PATH_INFO]
       key = unescape($1)
-      case env["REQUEST_METHOD"]
+      case env[REQUEST_METHOD]
       when "GET"
         get(key, env)
       when "HEAD"