Some code optimization

* Removed unnecessary `strings.ToLower()`.
* Removed redundant `u` variable.
pull/2416/head
Kirill Motkov 2020-04-06 11:53:59 +03:00
parent 8d75477412
commit 0fdad6f0fd
1 changed files with 2 additions and 3 deletions

View File

@ -146,10 +146,9 @@ func (v *TimedUserValidator) Remove(email string) bool {
v.Lock()
defer v.Unlock()
email = strings.ToLower(email)
idx := -1
for i, u := range v.users {
if strings.EqualFold(u.user.Email, email) {
for i := range v.users {
if strings.EqualFold(v.users[i].user.Email, email) {
idx = i
break
}