diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2020-09-07 15:33:46 +0200 |
---|---|---|
committer | Andrei Golubev <andrei.golubev@qt.io> | 2020-09-10 17:31:31 +0200 |
commit | 781ecbfc6f1346db5c08ce972dc1ff64dd003dd0 (patch) | |
tree | f77e0e38f2a411cb3c2ae2a3a53c966735ed6e20 /src/corelib/text/qstring.h | |
parent | ec7e680c5007345c34542a57bd2ac344fb112063 (diff) |
QString/QBA: change realloc*Data signatures to use qsizetype
Changed reallocData, reallocGrowData signatures to use qsizetype
instead of size_t
Change-Id: Iebe7def5430d3d3f4660e19cb6c12612543c5abc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/text/qstring.h')
-rw-r--r-- | src/corelib/text/qstring.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index 62826d67e2..e11457461c 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -951,8 +951,8 @@ private: friend inline bool operator< (QChar, QLatin1String) noexcept; friend inline bool operator> (QChar, QLatin1String) noexcept; - void reallocData(size_t alloc, Data::ArrayOptions options); - void reallocGrowData(size_t alloc, Data::ArrayOptions options); + void reallocData(qsizetype alloc, Data::ArrayOptions options); + void reallocGrowData(qsizetype alloc, Data::ArrayOptions options); static int compare_helper(const QChar *data1, qsizetype length1, const QChar *data2, qsizetype length2, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept; @@ -1167,7 +1167,7 @@ inline QString::~QString() {} inline void QString::reserve(qsizetype asize) { if (d->needsDetach() || asize >= capacity() - d.freeSpaceAtBegin()) { - reallocData(size_t(qMax(asize, size())), d->detachFlags() | Data::CapacityReserved); + reallocData(qMax(asize, size()), d->detachFlags() | Data::CapacityReserved); } else { d->setFlag(Data::CapacityReserved); } @@ -1177,8 +1177,8 @@ inline void QString::squeeze() { if ((d->flags() & Data::CapacityReserved) == 0) return; - if (d->needsDetach() || int(d.size) < capacity()) { - reallocData(size_t(d.size), d->detachFlags() & ~Data::CapacityReserved); + if (d->needsDetach() || d.size < capacity()) { + reallocData(d.size, d->detachFlags() & ~Data::CapacityReserved); } else { d->clearFlag(Data::CapacityReserved); } |