refs #937 Resolved clazy warnings: unnecessary memory allocation.

This commit is contained in:
Mathew Sutcliffe
2017-04-17 00:03:33 +01:00
parent fce1513dae
commit b7f69c6887
26 changed files with 52 additions and 51 deletions

View File

@@ -75,7 +75,7 @@ namespace BlackMisc
obj.insert("name", this->getName());
obj.insert("modelstring", QJsonValue(this->m_modelString));
obj.insert("description", QJsonValue(this->m_description));
obj.insert("mode", QJsonValue(getModelModeAsString().left(1).toUpper()));
obj.insert("mode", QJsonValue(getModelModeAsString().left(1).toUpper())); // clazy:exclude=qstring-left
// sims
const CSimulatorInfo sim(getSimulator());

View File

@@ -219,7 +219,7 @@ namespace BlackMisc
QString fltSection("[FLTSIM.0]");
int fltsimCounter = 0;
FileSection currentSection = Unknown;
bool isRotorcraftPath = fileName.toLower().contains("rotorcraft");
bool isRotorcraftPath = fileName.contains("rotorcraft", Qt::CaseInsensitive);
while (!in.atEnd())
{
@@ -391,7 +391,7 @@ namespace BlackMisc
if (index < 0) { return ""; }
if (line.length() < index + 1) { return ""; }
QString content(line.mid(index + 1).trimmed());
QString content(line.midRef(index + 1).trimmed().toString());
// fix "" strings, some are malformed and just contain " at beginning, not at the end
if (content.endsWith('"')) { content.remove(content.size() - 1 , 1); }