Commit c6f1fb5d authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Micro-optimization of [Word.append]. 25% gain on compcert_pre_parser.

parent 2941109f
......@@ -289,7 +289,12 @@ module Terminal = struct
intern (String.make 1 (Char.chr t))
let append w1 w2 =
intern (w1 ^ w2)
if String.length w1 = 0 then
w2
else if String.length w2 = 0 then
w1
else
intern (w1 ^ w2)
let length =
String.length
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment