diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2017-11-18 20:42:28 +0300 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2018-01-23 00:00:18 +0000 |
commit | 901bf1f7749e79a9fae2999d50131496dcaf4036 (patch) | |
tree | 1109c9c249540534fdbab19ffa54f98984c11518 /src/shared | |
parent | 46a700d8757badddadf4b3dbe06bfc2ad5ca9780 (diff) | |
download | qbs-901bf1f7749e79a9fae2999d50131496dcaf4036.tar.gz |
Use 'auto' keywords more for the allocated variables
Change-Id: I25ec97e64522d7fa486fcf408d8134cbbd8b24ea
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/json/json.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/json/json.cpp b/src/shared/json/json.cpp index 95c1fbcdf..b2c77a036 100644 --- a/src/shared/json/json.cpp +++ b/src/shared/json/json.cpp @@ -545,7 +545,7 @@ public: Header *h = (Header *)raw; h->tag = JsonDocument::BinaryFormatTag; h->version = 1; - Data *d = new Data(raw, size); + auto d = new Data(raw, size); d->compactionCounter = (b == header->root()) ? compactionCounter : 0; return d; } @@ -3347,7 +3347,7 @@ JsonDocument JsonDocument::fromRawData(const char *data, int size, DataValidatio return JsonDocument(); } - Internal::Data *d = new Internal::Data((char *)data, size); + auto d = new Internal::Data((char *)data, size); d->ownsData = false; if (validation != BypassValidation && !d->valid()) { @@ -3405,7 +3405,7 @@ JsonDocument JsonDocument::fromBinaryData(const std::string &data, DataValidatio return JsonDocument(); memcpy(raw, data.data(), size); - Internal::Data *d = new Internal::Data(raw, size); + auto d = new Internal::Data(raw, size); if (validation != BypassValidation && !d->valid()) { delete d; @@ -4046,7 +4046,7 @@ JsonDocument Parser::parse(JsonParseError *error) error->offset = 0; error->error = JsonParseError::NoError; } - Data *d = new Data(data, current); + auto d = new Data(data, current); return JsonDocument(d); } |