diff options
author | Akira Matsuda <ronnie@dio.jp> | 2013-01-28 15:23:31 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2013-01-28 15:23:31 +0900 |
commit | 59deaecc76be1b9dcdc3c4865375287560add1d1 (patch) | |
tree | ce769b5cee11c7dc76677316858e69a8a243dfeb /activesupport/lib/active_support/cache | |
parent | 789df3be3eaad5861647f22b02d362fd36a40657 (diff) | |
download | rails-59deaecc76be1b9dcdc3c4865375287560add1d1.tar.gz rails-59deaecc76be1b9dcdc3c4865375287560add1d1.tar.bz2 rails-59deaecc76be1b9dcdc3c4865375287560add1d1.zip |
Use already defined Encoding constants rather than creating one-trip Strings
Diffstat (limited to 'activesupport/lib/active_support/cache')
-rw-r--r-- | activesupport/lib/active_support/cache/mem_cache_store.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/cache/mem_cache_store.rb b/activesupport/lib/active_support/cache/mem_cache_store.rb index 712db2c75a..c7dbfc95dc 100644 --- a/activesupport/lib/active_support/cache/mem_cache_store.rb +++ b/activesupport/lib/active_support/cache/mem_cache_store.rb @@ -158,7 +158,7 @@ module ActiveSupport # characters properly. def escape_key(key) key = key.to_s.dup - key = key.force_encoding("BINARY") + key = key.force_encoding(Encoding::ASCII_8BIT) key = key.gsub(ESCAPE_KEY_CHARS){ |match| "%#{match.getbyte(0).to_s(16).upcase}" } key = "#{key[0, 213]}:md5:#{Digest::MD5.hexdigest(key)}" if key.size > 250 key |