From ba11691d36ba898f02e0c4d974e921113ab7d522 Mon Sep 17 00:00:00 2001 From: Inhere Date: Sun, 4 Jun 2023 12:44:47 +0800 Subject: [PATCH] :necktie: up: math - rename the func CompIntOrFloat() to CompValue() --- mathutil/check.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mathutil/check.go b/mathutil/check.go index 2f2aa91a1..055fc4df0 100644 --- a/mathutil/check.go +++ b/mathutil/check.go @@ -46,21 +46,21 @@ func Compare(srcVal, dstVal any, op string) (ok bool) { // CompInt compare int,uint value. returns `srcVal op(=,!=,<,<=,>,>=) dstVal` func CompInt[T comdef.Xint](srcVal, dstVal T, op string) (ok bool) { - return CompIntOrFloat(srcVal, dstVal, op) + return CompValue(srcVal, dstVal, op) } // CompInt64 compare int64 value. returns `srcVal op(=,!=,<,<=,>,>=) dstVal` func CompInt64(srcVal, dstVal int64, op string) bool { - return CompIntOrFloat(srcVal, dstVal, op) + return CompValue(srcVal, dstVal, op) } // CompFloat compare float64,float32 value. returns `srcVal op(=,!=,<,<=,>,>=) dstVal` func CompFloat[T comdef.Float](srcVal, dstVal T, op string) (ok bool) { - return CompIntOrFloat(srcVal, dstVal, op) + return CompValue(srcVal, dstVal, op) } -// CompIntOrFloat compare intX,uintX,floatX value. returns `srcVal op(=,!=,<,<=,>,>=) dstVal` -func CompIntOrFloat[T comdef.XintOrFloat](srcVal, dstVal T, op string) (ok bool) { +// CompValue compare intX,uintX,floatX value. returns `srcVal op(=,!=,<,<=,>,>=) dstVal` +func CompValue[T comdef.XintOrFloat](srcVal, dstVal T, op string) (ok bool) { switch op { case "<", "lt": ok = srcVal < dstVal