Project

General

Profile

« Previous | Next » 

Revision 0085153c

Added by Ewoud Kohl van Wijngaarden 2 months ago

Fixes #37287 - Iterate on hashes when both key and value are used

This replaces the `hash.keys.each { |k| hash[k] }` and `hash.keys.sort`
patterns with `hash.each { |k, v| }` where it makes sense. This avoids
doing hash lookups when you already know the value anyway.

View differences:

test/controllers/api/v2/report_templates_controller_test.rb
end
def stub_plan(opts = {})
opts.keys.each { |k| plan.send("#{k}=", opts[k]) }
opts.each { |k, v| plan.send("#{k}=", v) }
@controller.expects(:load_dynflow_plan).with('JOBID').returns(plan)
end

Also available in: Unified diff