Skip to content

Commit ee745cd

Browse files
committed
fixup! deps(opam): Add Irmin-git 3.10.0
1 parent 12d5160 commit ee745cd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/server/learnocaml_server.ml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -784,9 +784,8 @@ let last_modified = (* server startup time *)
784784
(tm.tm_year + 1900)
785785
tm.tm_hour tm.tm_min tm.tm_sec
786786

787-
(* Taken from the source of "decompress.1.5.3", from bin/decompress.ml *)
787+
(* Adapted from the source of "decompress.1.5.3", from bin/decompress.ml *)
788788
let compress ?(level = 4) data =
789-
790789
let bigstring_output o off len buf =
791790
let res = Bytes.create len in
792791
for i = 0 to len - 1 do
@@ -795,11 +794,13 @@ let compress ?(level = 4) data =
795794
; Buffer.add_bytes buf res in
796795
let src_len = String.length data in
797796
let dst_bound = De.Def.Ns.compress_bound src_len in
798-
let o = De.bigstring_create De.io_buffer_size in
797+
let o = De.bigstring_create dst_bound in
798+
(* buffer.mli: nothing bad will happen if the buffer grows beyond that limit: *)
799799
let buf = Buffer.create dst_bound in
800-
let q = De.Queue.create De.io_buffer_size in
800+
(* de.mli: we recommend a queue as large as output buffer: *)
801+
let q = De.Queue.create dst_bound in
802+
(* LZ77 with a 32.kB sliding-window compression: *)
801803
let w = De.Lz77.make_window ~bits:15 in
802-
803804
let open Zl in
804805
let encoder = Def.encoder (`String data) `Manual ~q ~w ~level in
805806
let rec go encoder =

0 commit comments

Comments
 (0)