From 8beae454635de9a8a5f999f2f7322096996ed178 Mon Sep 17 00:00:00 2001 From: Stefan Muenzel Date: Mon, 21 Oct 2019 09:32:13 +0800 Subject: [PATCH] Use Pipe.singleton in cohttp-async/body_raw Use Pipe.singleton when the pipe only contains one value, as it is more efficient than Pipe.of_list --- cohttp-async/src/body_raw.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cohttp-async/src/body_raw.ml b/cohttp-async/src/body_raw.ml index e18a2a6b22..5980d8938b 100644 --- a/cohttp-async/src/body_raw.ml +++ b/cohttp-async/src/body_raw.ml @@ -37,7 +37,7 @@ let is_empty (body:t) = let to_pipe = function | `Empty -> Pipe.of_list [] - | `String s -> Pipe.of_list [s] + | `String s -> Pipe.singleton s | `Strings sl -> Pipe.of_list sl | `Pipe p -> p