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());
|
||||
if (compileCommandsFile.size() > 1)
|
||||
compileCommandsFile.write(",");
|
||||
compileCommandsFile.write('\n' + QJsonDocument(json).toJson().trimmed());
|
||||
compileCommandsFile.write(QJsonDocument(json).toJson(QJsonDocument::Compact));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
compileCommandsFile.write("\n]");
|
||||
compileCommandsFile.write("]");
|
||||
compileCommandsFile.close();
|
||||
return GenerateCompilationDbResult(compileCommandsFile.fileName(), QString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user