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

View File

@ -102,10 +102,8 @@ 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)
}
}
// cleanExpired removes expired CAPTCHAs in a loop.
func (imcdb *InMemoryCaptchaDB) cleanExpired() {