From 16d301bab5b7dec53be4786b3b6815bca54ae539 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Thu, 23 Apr 2015 14:55:11 +0200 Subject: Remove almost all the uses of string concatenation when building error messages. Since error messages are ultimately passed to Format, which has its own buffers for concatenating strings, using concatenation for preparing error messages just doubles the workload and increases memory pressure. --- lib/pp.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/pp.ml') diff --git a/lib/pp.ml b/lib/pp.ml index d672f06dbb..9667f7270e 100644 --- a/lib/pp.ml +++ b/lib/pp.ml @@ -249,7 +249,7 @@ let escape_string s = else escape_at s (i-1) in escape_at s (String.length s - 1) -let qstring s = str ("\""^escape_string s^"\"") +let qstring s = str "\"" ++ str (escape_string s) ++ str "\"" let qs = qstring let quote s = h 0 (str "\"" ++ s ++ str "\"") -- cgit v1.2.3