From 6dd9c0720b3ae814aecf50453e91c3b450085471 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 14 Nov 2019 16:51:36 +0100 Subject: Small cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic8ed50a05a9723ed252f0762d86e41fe719fc3ef Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Thiago Macieira --- src/corelib/tools/qarraydata.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/corelib/tools/qarraydata.cpp') diff --git a/src/corelib/tools/qarraydata.cpp b/src/corelib/tools/qarraydata.cpp index b72ca201311..f22ff440bcd 100644 --- a/src/corelib/tools/qarraydata.cpp +++ b/src/corelib/tools/qarraydata.cpp @@ -190,14 +190,6 @@ static QArrayData *allocateData(size_t allocSize, uint options) return header; } -static QArrayData *reallocateData(QArrayData *header, size_t allocSize, uint options) -{ - header = static_cast(::realloc(header, allocSize)); - if (header) - header->flags = options; - return header; -} - void *QArrayData::allocate(QArrayData **dptr, size_t objectSize, size_t alignment, size_t capacity, ArrayOptions options) noexcept { @@ -260,8 +252,9 @@ QArrayData::reallocateUnaligned(QArrayData *data, void *dataPointer, size_t allocSize = calculateBlockSize(capacity, objectSize, headerSize, options); qptrdiff offset = reinterpret_cast(dataPointer) - reinterpret_cast(data); options |= AllocatedDataType | MutableData; - QArrayData *header = reallocateData(data, allocSize, options); + QArrayData *header = static_cast(::realloc(data, size_t(allocSize))); if (header) { + header->flags = options; header->alloc = uint(capacity); dataPointer = reinterpret_cast(header) + offset; } -- cgit v1.2.3