1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-06-11 21:49:26 -04:00

Some code improvements

* Rewrite empty string checks more idiomatically.
* Change strings.ToLower comparisons to strings.EqualFold.
* Rewrite switch statement with only one case as if.
This commit is contained in:
Kirill Motkov
2019-06-14 16:47:28 +03:00
parent 4c93d36d49
commit 0401a91ef4
26 changed files with 38 additions and 39 deletions

View File

@@ -149,7 +149,7 @@ func (v *TimedUserValidator) Remove(email string) bool {
email = strings.ToLower(email)
idx := -1
for i, u := range v.users {
if strings.ToLower(u.user.Email) == email {
if strings.EqualFold(u.user.Email, email) {
idx = i
break
}