Correct performance warnings

This commit is contained in:
Ben RUBSON 2017-11-05 17:48:50 +01:00 committed by GitHub
parent 707eddabf4
commit 00bd6d3c45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -180,6 +180,7 @@ if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.5) # Need 3.6 or abo
",-google-runtime-int"
",-google-runtime-references"
",-modernize-loop-convert"
",-performance-inefficient-string-concatenation"
",-readability-inconsistent-declaration-parameter-name"
",-readability-named-parameter"
)

View File

@ -465,7 +465,7 @@ bool saveConfig(ConfigType type, const string &rootDir,
template <typename T>
tinyxml2::XMLElement *addEl(tinyxml2::XMLDocument &doc,
tinyxml2::XMLNode *parent, const char *name,
T value) {
const T &value) {
auto el = doc.NewElement(name);
el->SetText(value);
parent->InsertEndChild(el);
@ -475,7 +475,7 @@ tinyxml2::XMLElement *addEl(tinyxml2::XMLDocument &doc,
template <>
tinyxml2::XMLElement *addEl<>(tinyxml2::XMLDocument &doc,
tinyxml2::XMLNode *parent, const char *name,
Interface iface) {
const Interface &iface) {
auto el = doc.NewElement(name);
auto n = doc.NewElement("name");
@ -497,7 +497,7 @@ tinyxml2::XMLElement *addEl<>(tinyxml2::XMLDocument &doc,
template <>
tinyxml2::XMLElement *addEl<>(tinyxml2::XMLDocument &doc,
tinyxml2::XMLNode *parent, const char *name,
std::vector<unsigned char> data) {
const std::vector<unsigned char> &data) {
string v = string("\n") + B64StandardEncode(data) + "\n";
return addEl(doc, parent, name, v.c_str());
}