From 91119c23370c54cd74d6350bcba7975805c3e9bf Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 10 Nov 2022 13:34:00 +0300 Subject: Use small_vector for some script types --- libbuild2/script/script.hxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libbuild2') diff --git a/libbuild2/script/script.hxx b/libbuild2/script/script.hxx index f9e0fa9..cccad98 100644 --- a/libbuild2/script/script.hxx +++ b/libbuild2/script/script.hxx @@ -265,7 +265,7 @@ namespace build2 cleanup_type type; build2::path path; }; - using cleanups = vector; // @@ Make it small_vector<..., 1>? + using cleanups = small_vector; // command_exit // @@ -361,7 +361,11 @@ namespace build2 // command_pipe // - using command_pipe = vector; // @@ Make it small_vector<..., 1>? + // Note that we cannot use small_vector here, since moving from objects of + // the command_pipe type would invalidate the command redirects of the + // reference type in this case. + // + using command_pipe = vector; void to_stream (ostream&, const command_pipe&, command_to_stream); @@ -379,7 +383,7 @@ namespace build2 command_pipe pipe; }; - using command_expr = vector; // @@ Make it small_vector<..., 1>? + using command_expr = small_vector; void to_stream (ostream&, const command_expr&, command_to_stream); -- cgit v1.1