Skip to content

Commit b02b27e

Browse files
committed
Review: rewrite as if/else instead of two returns
1 parent e5ed9cc commit b02b27e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

spec/ruby/core/module/fixtures/refine.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ def foo; "foo from included module"; end
1616
end
1717

1818
def self.build_refined_class(for_super: false)
19-
return Class.new(ClassWithSuperFoo) if for_super
20-
21-
return Class.new(ClassWithFoo)
19+
if for_super
20+
Class.new(ClassWithSuperFoo)
21+
else
22+
Class.new(ClassWithFoo)
23+
end
2224
end
2325
end

0 commit comments

Comments
 (0)