use golang built-in functions rather than mathutil
Enhancement
like we can use max rather than
https://github.com/pingcap/tidb/blob/7158ac65ee454d38455cd636b562649b08906e18/pkg/util/mathutil/math.go#L71-L80
I have worked on this issue @lance6716
/assign @Anudhyan
Thanks a lot @lance6716
@lance6716 when will this be reviewed?
@lance6716 when will this be reviewed?
I'll take a look at Monday
@lance6716 I have updated the code using inbuilt function and it is running without errors. Please check it
@Anudhyan Please read the issue. Use golang built-in functions like https://pkg.go.dev/builtin#max. And delete mathutil. Max
@Anudhyan Please read the issue. Use golang built-in functions like https://pkg.go.dev/builtin#max. And delete
mathutil. Max
@lance6716 Do I need to do the same for this file only? [tidb/pkg/util/mathutil/math.go]
I have used slices replace custom Max Min functions and removed mathutil.max from line 45 with ^uint64(0). Please guide me if there is any error from my side. I am contributing for the first time!
Do I need to do the same for this file only? [tidb/pkg/util/mathutil/math.go]
No. Delete mathutil.Max and let caller use golang built-in max. Also for min and other proper functions.
@lance6716 I was working on this issue. This is the first time I am working on issue for TiDB. Please reassign it to me
@lance6716 are you talking about this change:
result := math.Max(float64(a), float64(b))
@lance6716 are you talking about this change:
result := math.Max(float64(a), float64(b))
I don't know where's the code you refer to. I think the issue is clear and I don't know how to provide more details
Okay, thanks for the clarification! So, @Anudhyan you have to delete mathutil.Max and mathutil.Min and replace them with Go's built-in max and min functions
Okay, thanks for the clarification! So, @Anudhyan you have to delete mathutil.Max and mathutil.Min and replace them with Go's built-in math.Max and math.Min functions
The built-in functions are called max, min rather than math.Max and math.Min
Okay, thanks for the clarification! So, @Anudhyan you have to delete mathutil.Max and mathutil.Min and replace them with Go's built-in math.Max and math.Min functions
The built-in functions are called
max,minrather thanmath.Maxandmath.Min
@lance6716 the built in max and min are not variadic in nature. So how will I implement it here for variable n set of arguments?
Obviously max and min ARE variadic in nature. Please learn some basic golang knowledge before you contribute.
/assign @songzhibin97
@lance6716: GitHub didn't allow me to assign the following users: songzhibin97.
Note that only pingcap members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. For more information please see the contributor guide
In response to this:
/assign @songzhibin97
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.