forked from qt-creator/qt-creator
ClangCodeModel: Save some disk space and unneeded allocations
... when writing out compile_commands.json files. Change-Id: I8b2298eee87609a90ebb4dbd58b38bd6f36c5a7b Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -185,12 +185,12 @@ GenerateCompilationDbResult generateCompilationDB(QList<ProjectInfo::ConstPtr> p
|
|||||||
optionsBuilder.isClStyle());
|
optionsBuilder.isClStyle());
|
||||||
if (compileCommandsFile.size() > 1)
|
if (compileCommandsFile.size() > 1)
|
||||||
compileCommandsFile.write(",");
|
compileCommandsFile.write(",");
|
||||||
compileCommandsFile.write('\n' + QJsonDocument(json).toJson().trimmed());
|
compileCommandsFile.write(QJsonDocument(json).toJson(QJsonDocument::Compact));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compileCommandsFile.write("\n]");
|
compileCommandsFile.write("]");
|
||||||
compileCommandsFile.close();
|
compileCommandsFile.close();
|
||||||
return GenerateCompilationDbResult(compileCommandsFile.fileName(), QString());
|
return GenerateCompilationDbResult(compileCommandsFile.fileName(), QString());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user