From 412eac65c2ec45d027f98df87538333184098b42 Mon Sep 17 00:00:00 2001 From: Michele Alberti <michele.alberti@cea.fr> Date: Fri, 24 Jan 2020 09:07:32 +0100 Subject: [PATCH] [sanitizer] Update to OCaml 4.05 (use of Buffer.truncate). --- src/libraries/utils/sanitizer.ml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/libraries/utils/sanitizer.ml b/src/libraries/utils/sanitizer.ml index cb0d0148b09..88e5d52951d 100644 --- a/src/libraries/utils/sanitizer.ml +++ b/src/libraries/utils/sanitizer.ml @@ -63,7 +63,7 @@ let add_sep buffer = else begin buffer.state <- TRUNCATE ; - (* TODO [OCaml 4.05] Buffer.truncate buffer.content buffer.lastsep ; *) + Buffer.truncate buffer.content buffer.lastsep end let add_char buffer = function @@ -92,8 +92,4 @@ let rec add_list buffer = function | p::ps -> add_string buffer p ; add_sep buffer ; add_list buffer ps let contents buffer = - (* TODO [OCaml 4.05] simply buffer contents if using Buffer.truncate *) - let s = Buffer.contents buffer.content in - if buffer.state = TRUNCATE then - String.sub s 0 buffer.lastsep - else s + Buffer.contents buffer.content -- GitLab