diff options
author | bptato <nincsnevem662@gmail.com> | 2023-09-14 03:53:54 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-09-14 03:53:54 +0200 |
commit | 15c722c013c209e72a277908276c3d851943ecdd (patch) | |
tree | 543ed8dbfeb7f9711d6ea9b558d42bd50d0fe0e8 /src/server/buffer.nim | |
parent | 1c494d3fd5fb746d5a5b6d582119cda261e1e7b5 (diff) | |
download | chawan-15c722c013c209e72a277908276c3d851943ecdd.tar.gz |
buffer: directly pass EncoderStream to parseStylesheet
No need for that extra copy into a StringStream.
Diffstat (limited to 'src/server/buffer.nim')
-rw-r--r-- | src/server/buffer.nim | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim index 6303fd65..5bdef808 100644 --- a/src/server/buffer.nim +++ b/src/server/buffer.nim @@ -607,9 +607,8 @@ proc loadResource(buffer: Buffer, elem: HTMLLinkElement): EmptyPromise = let ss = newStringStream(s.get) #TODO non-utf-8 css let ds = newDecoderStream(ss, cs = CHARSET_UTF_8) - let source = newEncoderStream(ds, cs = CHARSET_UTF_8).readAll() - let ss2 = newStringStream(source) - elem.sheet = parseStylesheet(ss2)) + let source = newEncoderStream(ds, cs = CHARSET_UTF_8) + elem.sheet = parseStylesheet(source)) proc loadResource(buffer: Buffer, elem: HTMLImageElement): EmptyPromise = let document = buffer.document |