Skip to content

Commit

Permalink
Reduce the nummer of else clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg-vr committed Oct 21, 2024
1 parent ca9b09e commit 2d87425
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions app/helpers/renderers/feedback_table_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -322,17 +322,13 @@ def messages(msgs)
def with_differ_class(t)
if t[:format] == 'csv'
begin
if CsvDiffer.limited_columns?(t[:generated]) && CsvDiffer.limited_columns?(t[:expected])
yield(CsvDiffer)
else
yield(TextDiffer)
end
return yield(CsvDiffer) if CsvDiffer.limited_columns?(t[:generated]) && CsvDiffer.limited_columns?(t[:expected])
rescue CSV::MalformedCSVError
yield(TextDiffer)
# use the default differ
end
else
yield(TextDiffer)
end

yield(TextDiffer)
end

def test_accepted(t)
Expand Down

0 comments on commit 2d87425

Please sign in to comment.