From cbd6af4665052e12f7f9804942df8f435fb0929c Mon Sep 17 00:00:00 2001 From: bptato Date: Sun, 13 Aug 2023 19:41:17 +0200 Subject: mimetypes: small optimization --- src/config/mimetypes.nim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/config/mimetypes.nim') diff --git a/src/config/mimetypes.nim b/src/config/mimetypes.nim index 2c2bcc50..2133d863 100644 --- a/src/config/mimetypes.nim +++ b/src/config/mimetypes.nim @@ -29,8 +29,7 @@ proc parseMimeTypes*(mimeTypes: var MimeTypes, stream: Stream) = ext &= line[i].tolower() inc i if ext == "": continue - if ext notin mimeTypes: - mimeTypes[ext] = t + discard mimeTypes.hasKeyOrPut(ext, t) stream.close() proc parseMimeTypes*(stream: Stream): MimeTypes = -- cgit 1.4.1-2-gfad0