Removed unnecessary guard around delete().

This commit is contained in:
Alexander Andreev 2023-01-12 04:39:22 +04:00
parent fcb656d4ea
commit f9154ab02f
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F
1 changed files with 1 additions and 3 deletions

View File

@ -102,9 +102,7 @@ func (imcdb *InMemoryCaptchaDB) IsSolved(id captcha.ID) bool {
func (imcdb *InMemoryCaptchaDB) Remove(id captcha.ID) {
imcdb.Lock()
defer imcdb.Unlock()
if _, ok := imcdb.db[id]; ok {
delete(imcdb.db, id)
}
delete(imcdb.db, id)
}
// cleanExpired removes expired CAPTCHAs in a loop.