Small refactoring in `mruby-hash-ext`.

parent 8b437546
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment