Re:Ruby's Hash Is A Swiss-Army Knife
by sinkwool on Monday August 21, 2023 @07:44AM
(#37208173)
You don't need the `unless k.key? v` guard. The `Hash.new` block only gets called when the key is not present in the hash.
[ Parent
| on HN ]
Re:Ruby's Hash Is A Swiss-Army Knife
by devoutsalsa on Monday August 21, 2023 @08:43AM
(#37208745)
The caching makes it faster the trade off being more using more memory. I just wanted to see if it’d work.