@@ -49,9 +49,7 @@ function crop_width_to_fit_string_in_field(str::AbstractString, field_width::Int
4949 if add_continuation_char
5050 cont_str_width = textwidth (continuation_char)
5151
52- if add_space_in_continuation_char
53- cont_str_width += 1
54- end
52+ add_space_in_continuation_char && (cont_str_width += 1 )
5553
5654 Δ += cont_str_width
5755
@@ -743,9 +741,7 @@ function _print_table_with_text_back_end(
743741 # Check which columns must have fixed sizes.
744742 columns_width isa Integer && (columns_width = fill (columns_width, num_columns))
745743
746- if length (columns_width) != num_columns
747- error (" The length of `columns_width` must be the same as the number of columns." )
748- end
744+ (length (columns_width) != num_columns) && error (" The length of `columns_width` must be the same as the number of columns." )
749745
750746 # The number of lines that must be skipped from printing ellipsis must be greater of equal 0.
751747 (ellipsis_line_skip < 0 ) && (ellipsis_line_skip = 0 )
@@ -1351,9 +1347,7 @@ function _is_cell_alignment_overridden(ptable::ProcessedTable, i::Int, j::Int)
13511347
13521348 # Search for alignment overrides in this cell.
13531349 for f in ptable. _data_cell_alignment
1354- alignment_override =
1355- f (_getdata (ptable. data), ir, jr):: Union{Nothing, Symbol}
1356-
1350+ alignment_override = f (_getdata (ptable. data), ir, jr):: Union{Nothing, Symbol}
13571351 if _is_alignment_valid (alignment_override)
13581352 return true
13591353 end
@@ -1991,9 +1985,7 @@ function _update_column_width(column_width::Int, largest_cell_width::Int, column
19911985 end
19921986
19931987 # Make sure that the minimum column width is respected.
1994- if (minimum_column_width > 0 ) && (minimum_column_width > column_width)
1995- column_width = minimum_column_width
1996- end
1988+ (minimum_column_width > 0 ) && (minimum_column_width > column_width) && (column_width = minimum_column_width)
19971989 else
19981990 column_width = column_width_specification
19991991 end
@@ -2027,11 +2019,7 @@ end
20272019
20282020# Return the available rows in `display`. If there is no row limit, this function returns -1.
20292021function _available_rows (display:: Display )
2030- if display. size[1 ] > 0
2031- return display. size[1 ] - display. row
2032- else
2033- return - 1
2034- end
2022+ return (display. size[1 ] > 0 ) ? (display. size[1 ] - display. row) : - 1
20352023end
20362024
20372025# Draw the continuation row when the table has filled the vertical space available. This
@@ -2574,11 +2562,7 @@ function _print_omitted_cell_summary(display::Display, num_omitted_cols::Int, nu
25742562 if show_omitted_cell_summary && ((num_omitted_cols + num_omitted_rows) > 0 )
25752563 cs_str = _get_omitted_cell_string (num_omitted_rows, num_omitted_cols)
25762564
2577- if display. size[2 ] > 0
2578- table_display_width = min (table_width, display. size[2 ])
2579- else
2580- table_display_width = table_width
2581- end
2565+ table_display_width = (display. size[2 ] > 0 ) ? min (table_width, display. size[2 ]) : table_width
25822566
25832567 if textwidth (cs_str) < table_display_width
25842568 cs_str = align_string (cs_str, table_display_width, :r )
0 commit comments