Skip to content

Commit

Permalink
refactor: avoid temp var
Browse files Browse the repository at this point in the history
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
  • Loading branch information
stuertz and hugovk committed Mar 27, 2024
1 parent 4d4481a commit c1fd089
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/prettytable/prettytable.py
Original file line number Diff line number Diff line change
Expand Up @@ -1605,8 +1605,7 @@ def _compute_widths(self, rows, options) -> None:
scale = (
self._max_table_width - per_col_padding * len(widths) - vrulers
) / (table_width - per_col_padding * len(widths) - vrulers)
widths = [max(1, int(w * scale)) for w in widths]
self._widths = widths
self._widths = [max(1, int(w * scale)) for w in widths]

# Are we under min_table_width or title width?
if self._min_table_width or options["title"]:
Expand Down

0 comments on commit c1fd089

Please sign in to comment.