diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2022-11-10 13:34:00 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2022-11-10 14:02:34 +0300 |
commit | 91119c23370c54cd74d6350bcba7975805c3e9bf (patch) | |
tree | 81020747dc2e27f76b86c4705ac4b779a4c96229 /libbuild2/script/script.hxx | |
parent | fca95dafaaab44d3e06e10bc9f3b45d00c82301f (diff) |
Use small_vector for some script types
Diffstat (limited to 'libbuild2/script/script.hxx')
-rw-r--r-- | libbuild2/script/script.hxx | 10 |
1 files changed, 7 insertions, 3 deletions
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<cleanup>; // @@ Make it small_vector<..., 1>? + using cleanups = small_vector<cleanup, 1>; // command_exit // @@ -361,7 +361,11 @@ namespace build2 // command_pipe // - using command_pipe = vector<command>; // @@ 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<command>; void to_stream (ostream&, const command_pipe&, command_to_stream); @@ -379,7 +383,7 @@ namespace build2 command_pipe pipe; }; - using command_expr = vector<expr_term>; // @@ Make it small_vector<..., 1>? + using command_expr = small_vector<expr_term, 1>; void to_stream (ostream&, const command_expr&, command_to_stream); |