QJsonDocument: enable NRVO for gcc in toJson()
Change-Id: I1b639272d38f8463b17a85a406addb74bb572756 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
3d76031217
commit
f620ad1499
|
|
@ -351,10 +351,9 @@ QByteArray QJsonDocument::toJson() const
|
|||
#ifndef QT_JSON_READONLY
|
||||
QByteArray QJsonDocument::toJson(JsonFormat format) const
|
||||
{
|
||||
if (!d)
|
||||
return QByteArray();
|
||||
|
||||
QByteArray json;
|
||||
if (!d)
|
||||
return json;
|
||||
|
||||
if (d->header->root()->isArray())
|
||||
QJsonPrivate::Writer::arrayToJson(static_cast<QJsonPrivate::Array *>(d->header->root()), json, 0, (format == Compact));
|
||||
|
|
|
|||
Loading…
Reference in New Issue