Ruby

Ruby

Made by DeepSource

Use yield instead of block call RB-PR1015

Performance
Major
Autofix

Use of a &block parameter and block.call can be replaced by yield in some cases.

Bad practice

def method(&block)
  block.call
end
def another(&func)
  func.call 1, 2, 3
end

Recommended

def method
  yield
end
def another
  yield 1, 2, 3
end