From 5de05a810cada95d6febf863452745fde7df9803 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Fri, 20 Aug 2021 00:47:51 +0200 Subject: [PATCH] Tell clang-tidy that expander_t::stage_variables intentionally takes values We don't want to convert the input to a "wcstring &" because "stage_variables" needs to have the same type as other stages, so we can use it in a loop. Communicate that to clang-tidy. We also don't want to take "wcstring &&". As the Google style guide states, it's not really beneficial here, and it potentially hurts readability because it's a relatively obscure feature. The rest of our code contains a bunch of && parameters. We might want to get rid of some of them. Closes #8227 --- src/expand.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/expand.cpp b/src/expand.cpp index 684a1a22a..07b11a9b2 100644 --- a/src/expand.cpp +++ b/src/expand.cpp @@ -1002,6 +1002,7 @@ expand_result_t expander_t::stage_cmdsubst(wcstring input, completion_receiver_t } } +// We pass by value to match other stages. NOLINTNEXTLINE(performance-unnecessary-value-param) expand_result_t expander_t::stage_variables(wcstring input, completion_receiver_t *out) { // We accept incomplete strings here, since complete uses expand_string to expand incomplete // strings from the commandline.