Coding style

- Remove redundant casts since round function returns int in this case.
This commit is contained in:
Andrew Hamilton 2022-03-07 19:15:04 +10:00
parent 607653271b
commit e54a07d038

View file

@ -59,8 +59,8 @@ def even_widths(column_widgets, width):
column_count = len(column_widgets)
widths = []
for index, column_widget in enumerate(column_widgets):
start_pos = int(round(float(width) / column_count * index))
end_pos = int(round(float(width) / column_count * (index+1)))
start_pos = round(float(width) / column_count * index)
end_pos = round(float(width) / column_count * (index+1))
widths.append(end_pos - start_pos)
return widths
@ -101,8 +101,8 @@ def even_partition(row_widgets, height):
row_count = len(row_widgets)
heights = []
for index, row_widget in enumerate(row_widgets):
start_pos = int(round(float(height) / row_count * index))
end_pos = int(round(float(height) / row_count * (index+1)))
start_pos = round(float(height) / row_count * index)
end_pos = round(float(height) / row_count * (index+1))
heights.append(end_pos - start_pos)
return heights