Small refactoring in `mruby-hash-ext`.
MODIFY
mrbgems/mruby-hash-ext/mrblib/hash.rb
mrbgems/mruby-hash-ext/mrblib/hash.rb
@@ -126,12 +126,12 @@ class Hash
#
def compact!
- h = {}
keys = self.keys
nk = keys.select{|k|
self[k] != nil
}
return nil if (keys.size == nk.size)
+ h = {}
nk.each {|k|
h[k] = self[k]
}
@@ -486,6 +486,7 @@ class Hash
end
hash
end
+
##
# call-seq:
# hsh.transform_values! {|key| block } -> hsh

Small refactoring in `mruby-hash-ext`.