mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
refs #937 Resolved clazy warnings: unnecessary memory allocation.
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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); }
|
||||
|
||||
Reference in New Issue
Block a user