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).
13 KiB
13 KiB