diff options
author | 2023-03-18 21:51:16 +0300 | |
---|---|---|
committer | 2023-03-18 21:51:16 +0300 | |
commit | 53b9b3735c0b7a167035b7aa46086e1a37f0c166 (patch) | |
tree | d8c581dd866cf1c32eabac77e58881ed979d9d41 /test/test_helpers/envvar.cpp | |
parent | 674ff82c12f5addf99b1c91d7873b82d55c86e56 (diff) | |
download | newsboat-53b9b3735c0b7a167035b7aa46086e1a37f0c166.tar.gz newsboat-53b9b3735c0b7a167035b7aa46086e1a37f0c166.tar.zst newsboat-53b9b3735c0b7a167035b7aa46086e1a37f0c166.zip |
Avoid passing `std::string` by value
This fixes a cppcheck warning.
In test/test_helpers/envvar.cpp we still pass by value, but now it makes
sense performance-wise because we're moving from it.
Diffstat (limited to '')
-rw-r--r-- | test/test_helpers/envvar.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/test_helpers/envvar.cpp b/test/test_helpers/envvar.cpp index 7d44b486..9ef93920 100644 --- a/test/test_helpers/envvar.cpp +++ b/test/test_helpers/envvar.cpp @@ -3,11 +3,11 @@ #include "3rd-party/catch.hpp" test_helpers::EnvVar::EnvVar(std::string name_) - : EnvVar(name_, true) + : EnvVar(std::move(name_), true) { - if (name_ == "TZ") { + if (name == "TZ") { throw std::invalid_argument("Using EnvVar(\"TZ\") is discouraged. Try test_helpers::TzEnvVar instead."); - } else if (name_ == "LC_CTYPE") { + } else if (name == "LC_CTYPE") { throw std::invalid_argument("Using EnvVar(\"LC_CTYPE\") is discouraged. Try test_helpers::LcCtypeEnvVar instead."); } } |