Skip to content
Snippets Groups Projects
Commit 7c9db8f8 authored by Daniel Pfeifer's avatar Daniel Pfeifer Committed by Brad King
Browse files

clang-tidy: apply performance-unnecessary-value-param fixes

parent b88843d6
No related branches found
No related tags found
No related merge requests found
......@@ -242,7 +242,7 @@ std::string cmJoin(Range const& r, const char* delimiter)
}
template <typename Range>
std::string cmJoin(Range const& r, std::string delimiter)
std::string cmJoin(Range const& r, std::string const& delimiter)
{
return cmJoin(r, delimiter.c_str());
}
......@@ -344,13 +344,13 @@ typename Range::const_iterator cmRemoveDuplicates(Range& r)
}
template <typename Range>
std::string cmWrap(std::string prefix, Range const& r, std::string suffix,
std::string sep)
std::string cmWrap(std::string const& prefix, Range const& r,
std::string const& suffix, std::string const& sep)
{
if (r.empty()) {
return std::string();
}
return prefix + cmJoin(r, (suffix + sep + prefix).c_str()) + suffix;
return prefix + cmJoin(r, suffix + sep + prefix) + suffix;
}
template <typename Range>
......
......@@ -242,7 +242,7 @@ public:
/** Used for parallel ctest job scheduling */
std::string GetScheduleType() { return this->ScheduleType; }
void SetScheduleType(std::string type) { this->ScheduleType = type; }
void SetScheduleType(std::string const& type) { this->ScheduleType = type; }
/** The max output width */
int GetMaxTestNameWidth() const;
......
......@@ -65,13 +65,15 @@ private:
struct GeneratorExpressionContent : public cmGeneratorExpressionEvaluator
{
GeneratorExpressionContent(const char* startContent, size_t length);
void SetIdentifier(std::vector<cmGeneratorExpressionEvaluator*> identifier)
void SetIdentifier(
std::vector<cmGeneratorExpressionEvaluator*> const& identifier)
{
this->IdentifierChildren = identifier;
}
void SetParameters(
std::vector<std::vector<cmGeneratorExpressionEvaluator*> > parameters)
std::vector<std::vector<cmGeneratorExpressionEvaluator*> > const&
parameters)
{
this->ParamChildren = parameters;
}
......
......@@ -148,7 +148,7 @@ public:
void AppendDefines(std::set<std::string>& defines,
const char* defines_list) const;
void AppendDefines(std::set<std::string>& defines,
std::string defines_list) const
std::string const& defines_list) const
{
this->AppendDefines(defines, defines_list.c_str());
}
......
......@@ -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,
......
......@@ -32,7 +32,7 @@ public:
* \param name a encoding name.
* \return encoding enum value or Auto if \a name was not found.
*/
static Encoding FindEncoding(std::string name);
static Encoding FindEncoding(std::string const& name);
/// The code page that is used as internal encoding to which we will encode.
static unsigned int defaultCodepage;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment