From 4d389424e456a1915fa76255ca56ae728b2791bc Mon Sep 17 00:00:00 2001 From: Anton Davydov Date: Sun, 5 Apr 2015 14:47:04 +0300 Subject: [PATCH] Use Hash#each_key instead of Hash#keys.each --- lib/sidekiq/core_ext.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sidekiq/core_ext.rb b/lib/sidekiq/core_ext.rb index 1de78e3a..959b52f4 100644 --- a/lib/sidekiq/core_ext.rb +++ b/lib/sidekiq/core_ext.rb @@ -54,14 +54,14 @@ begin rescue LoadError class Hash def stringify_keys - keys.each do |key| + each_key do |key| self[key.to_s] = delete(key) end self end if !{}.respond_to?(:stringify_keys) def symbolize_keys - keys.each do |key| + each_key do |key| self[(key.to_sym rescue key) || key] = delete(key) end self