about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-08-13 19:41:17 +0200
committerbptato <nincsnevem662@gmail.com>2023-08-13 19:41:17 +0200
commitcbd6af4665052e12f7f9804942df8f435fb0929c (patch)
tree43b2eca1b1b30847366f90bc728e9fb6d59d98a6 /src
parent069685478c6bd8c38723b10158464c33ecdfc9c7 (diff)
downloadchawan-cbd6af4665052e12f7f9804942df8f435fb0929c.tar.gz
mimetypes: small optimization
Diffstat (limited to 'src')
-rw-r--r--src/config/mimetypes.nim3
1 files changed, 1 insertions, 2 deletions
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 =