improve CheckTruth, chek val empty first

This commit is contained in:
0x2d3c 2022-02-20 18:39:13 +08:00
parent 9e17be494b
commit 25de55b377

View File

@ -39,7 +39,7 @@ func IsValidDBNameChar(c rune) bool {
// CheckTruth check string true or not
func CheckTruth(vals ...string) bool {
for _, val := range vals {
if !strings.EqualFold(val, "false") && val != "" {
if val != "" && !strings.EqualFold(val, "false") {
return true
}
}