about summary refs log tree commit diff stats
path: root/src/io
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-09-27 02:48:21 +0200
committerbptato <nincsnevem662@gmail.com>2023-09-27 02:51:41 +0200
commitac3e737867245ac65adfa2352ce6e7fdacc57b18 (patch)
treee747a5891176c7dce618bafaf79d750d5a40416f /src/io
parent285b6f32c28d1cda403ba33bfb2d22c34fab2a1e (diff)
downloadchawan-ac3e737867245ac65adfa2352ce6e7fdacc57b18.tar.gz
buffer: simplify contentType handling
* remove contentType member of Buffer object
* add ishtml to reduce string comparisons
* consistent spelling: contenttype -> contentType
Diffstat (limited to 'src/io')
-rw-r--r--src/io/serialize.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/io/serialize.nim b/src/io/serialize.nim
index d2e83524..98f3a70a 100644
--- a/src/io/serialize.nim
+++ b/src/io/serialize.nim
@@ -391,7 +391,7 @@ proc swrite*(stream: Stream, source: BufferSource) =
   of LOAD_REQUEST: stream.swrite(source.request)
   of LOAD_PIPE: stream.swrite(source.fd)
   stream.swrite(source.location)
-  stream.swrite(source.contenttype)
+  stream.swrite(source.contentType)
   stream.swrite(source.charset)
 
 proc sread*(stream: Stream, source: var BufferSource) =
@@ -408,7 +408,7 @@ proc sread*(stream: Stream, source: var BufferSource) =
     source = BufferSource(t: LOAD_PIPE)
     stream.sread(source.fd)
   stream.sread(source.location)
-  stream.sread(source.contenttype)
+  stream.sread(source.contentType)
   stream.sread(source.charset)
 
 func slen*(source: BufferSource): int =
@@ -418,4 +418,4 @@ func slen*(source: BufferSource): int =
   of LOAD_REQUEST: result += slen(source.request)
   of LOAD_PIPE: result += slen(source.fd)
   result += slen(source.location)
-  result += slen(source.contenttype)
+  result += slen(source.contentType)