summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-hash-ext
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-07-15 08:50:52 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-07-15 08:50:52 +0900
commitd7fef24a95e122a5be2b9d0519e57a79fbe5da46 (patch)
treef676e175a5d9c530eb0d95cc246354f7a295c5f1 /mrbgems/mruby-hash-ext
parent460d6284906d53adbb722214a82ff717608733b8 (diff)
downloadmruby-d7fef24a95e122a5be2b9d0519e57a79fbe5da46.tar.gz
mruby-d7fef24a95e122a5be2b9d0519e57a79fbe5da46.zip
Use `keys.each` instead of unstable `each_keys`.
Diffstat (limited to 'mrbgems/mruby-hash-ext')
-rw-r--r--mrbgems/mruby-hash-ext/mrblib/hash.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/mrbgems/mruby-hash-ext/mrblib/hash.rb b/mrbgems/mruby-hash-ext/mrblib/hash.rb
index d3b4f6e86..14da1ddb5 100644
--- a/mrbgems/mruby-hash-ext/mrblib/hash.rb
+++ b/mrbgems/mruby-hash-ext/mrblib/hash.rb
@@ -396,7 +396,7 @@ class Hash
def transform_keys(&b)
return to_enum :transform_keys unless block_given?
hash = {}
- self.each_key do |k|
+ self.keys.each do |k|
new_key = yield(k)
hash[new_key] = self[k]
end
@@ -416,7 +416,7 @@ class Hash
def transform_values(&b)
return to_enum :transform_values unless block_given?
hash = {}
- self.each_key do |k|
+ self.keys.each do |k|
hash[k] = yield(self[k])
end
hash