Skip to content

Commit

Permalink
Use Hash#each_key instead of Hash#keys.each
Browse files Browse the repository at this point in the history
  • Loading branch information
davydovanton committed Apr 5, 2015
1 parent be7d77d commit 4d38942
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/sidekiq/core_ext.rb
Expand Up @@ -54,14 +54,14 @@ def singleton_class?
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
Expand Down

0 comments on commit 4d38942

Please sign in to comment.