diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-12-10 13:42:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-12-12 19:04:12 (GMT) |
commit | 7c9db8f8139b945d4c55d9061e4ef122351b210d (patch) | |
tree | dd2d523653994aeeb93e949550e3ac4ef27058be /Source/cmProcessOutput.cxx | |
parent | b88843d651dc2c500af13c1fe882b389c4949b04 (diff) | |
download | CMake-7c9db8f8139b945d4c55d9061e4ef122351b210d.zip CMake-7c9db8f8139b945d4c55d9061e4ef122351b210d.tar.gz CMake-7c9db8f8139b945d4c55d9061e4ef122351b210d.tar.bz2 |
clang-tidy: apply performance-unnecessary-value-param fixes
Diffstat (limited to 'Source/cmProcessOutput.cxx')
-rw-r--r-- | Source/cmProcessOutput.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/cmProcessOutput.cxx b/Source/cmProcessOutput.cxx index 8b4d0e1..617e1ca 100644 --- a/Source/cmProcessOutput.cxx +++ b/Source/cmProcessOutput.cxx @@ -9,7 +9,8 @@ unsigned int cmProcessOutput::defaultCodepage = KWSYS_ENCODING_DEFAULT_CODEPAGE; #endif -cmProcessOutput::Encoding cmProcessOutput::FindEncoding(std::string name) +cmProcessOutput::Encoding cmProcessOutput::FindEncoding( + std::string const& name) { Encoding encoding = Auto; if (name == "UTF8") { @@ -54,9 +55,13 @@ cmProcessOutput::~cmProcessOutput() bool cmProcessOutput::DecodeText(std::string raw, std::string& decoded, size_t id) { +#if !defined(_WIN32) + static_cast<void>(id); + decoded.swap(raw); + return true; +#else bool success = true; decoded = raw; -#if defined(_WIN32) if (id > 0) { if (rawparts.size() < id) { rawparts.reserve(id); @@ -113,10 +118,8 @@ bool cmProcessOutput::DecodeText(std::string raw, std::string& decoded, success = DoDecodeText(raw, decoded, NULL); } } -#else - static_cast<void>(id); -#endif return success; +#endif } bool cmProcessOutput::DecodeText(const char* data, size_t length, |