Files
ubicloud/Rakefile
Jeremy Evans 01a4956abd Avoid **hash.merge(other_hash) constructions
While this works, it's less efficient than alternatives.  If the method
accepts an options hash, the `**` can be dropped, avoiding a hash
allocation. If the method accepts keywords, `**hash, **other_hash` can
be used.

However, in the cases where we are using these constructions, one of
the hashes is a literal hash, so these constructions result in
2-3 hash allocations:

* 1 for the literal hash
* 1 for the Hash#merge
* 1 if the keyword splat is converted to a positional hash

using `**hash, kw: value` reduces this to a single hash allocation,
in addition to being simpler.

For the create_cache_entry change in the specs, use an anonymous keyword
splat parameter.  This is done for simplicity, it doesn't save
allocations in this case (as all callers are providing literal keywords).
2025-05-02 00:56:06 +09:00

13 KiB