diff options
author | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-09-27 11:31:32 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-27 11:31:32 +0200 |
commit | 150b8ca29417de2cd423ff92478eaf4cb2906601 (patch) | |
tree | aa1c43ee9d096a4464636bcb5f294a11846572f4 /src/corelib/tools/qstring.h | |
parent | bd78389fc4fe0a4367696ba2fdcc6e8d09863698 (diff) | |
parent | 16a36239ab9e9be45a940aeff94f35e29bdeb944 (diff) |
Merge "Merge branch 'stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/corelib/tools/qstring.h')
-rw-r--r-- | src/corelib/tools/qstring.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 701082c7e6..2eaed65148 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -934,8 +934,8 @@ inline QString::~QString() { if (!d->ref.deref()) Data::deallocate(d); } inline void QString::reserve(int asize) { - if (d->ref.isShared() || uint(asize) + 1u > d->alloc) - reallocData(uint(asize) + 1u); + if (d->ref.isShared() || uint(asize) >= d->alloc) + reallocData(qMax(asize, d->size) + 1u); if (!d->capacityReserved) { // cannot set unconditionally, since d could be the shared_null/shared_empty (which is const) |