Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace min/max helpers with built-in min/max #794

Merged
merged 1 commit into from
Nov 15, 2024
Merged

Conversation

Juneezee
Copy link
Contributor

@Juneezee Juneezee commented Nov 6, 2024

We can use the built-in min and max functions since Go 1.21.

Reference: https://go.dev/ref/spec#Min_and_max

We can use the built-in `min` and `max` functions since Go 1.21.

Reference: https://go.dev/ref/spec#Min_and_max
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Copy link
Contributor Author

@Juneezee Juneezee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The affected lines of code are:

widths[colIdx] = min(widths[colIdx], t.TableStyle.MaxColWidth)
minWidths[colIdx] = min(minWidths[colIdx], t.TableStyle.MaxColWidth)

and

widths[colIdx] = max((widths[colIdx]*budget)/baseline, minWidths[colIdx])

@Juneezee
Copy link
Contributor Author

@onsi friendly ping 😊

@onsi onsi merged commit ece6872 into onsi:master Nov 15, 2024
6 checks passed
@onsi
Copy link
Owner

onsi commented Nov 15, 2024

hey thanks, so for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants