diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2012-04-04 13:35:02 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-05 01:44:18 +0200 |
commit | 7488b79652cb18de3e2b295835c08a46f3e286f4 (patch) | |
tree | a089f97ff2dd88ac3491ca8312208bbfd3663d41 /src | |
parent | 4c892e14c6929e174c8bccc9ec5693a63a8ce69c (diff) |
Drop nullary overload of private QString::realloc
Change-Id: I196ec038ab7b648287e310525681f2d218059b51
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qstring.cpp | 15 | ||||
-rw-r--r-- | src/corelib/tools/qstring.h | 5 |
2 files changed, 8 insertions, 12 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 6935c76b42..c5c43673bc 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -1330,11 +1330,6 @@ void QString::realloc(int alloc) } } -void QString::realloc() -{ - realloc(d->size); -} - void QString::expand(int i) { int sz = d->size; @@ -2823,7 +2818,7 @@ QString& QString::replace(const QRegExp &rx, const QString &after) if (isEmpty() && rx2.indexIn(*this) == -1) return *this; - realloc(); + realloc(d->size); int index = 0; int numCaptures = rx2.captureCount(); @@ -2986,7 +2981,7 @@ QString &QString::replace(const QRegularExpression &re, const QString &after) if (!iterator.hasNext()) // no matches at all return *this; - realloc(); + realloc(d->size); int numCaptures = re.captureCount(); @@ -5088,8 +5083,10 @@ int QString::localeAwareCompare_helper(const QChar *data1, int length1, const ushort *QString::utf16() const { - if (IS_RAW_DATA(d)) - const_cast<QString*>(this)->realloc(); // ensure '\\0'-termination for ::fromRawData strings + if (IS_RAW_DATA(d)) { + // ensure '\0'-termination for ::fromRawData strings + const_cast<QString*>(this)->realloc(d->size); + } return d->data(); } diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 202b74dfbf..fd22eb78a8 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -651,7 +651,6 @@ private: static int grow(int); static void free(Data *); - void realloc(); void realloc(int alloc); void expand(int i); void updateProperties() const; @@ -748,7 +747,7 @@ inline QChar *QString::data() inline const QChar *QString::constData() const { return reinterpret_cast<const QChar*>(d->data()); } inline void QString::detach() -{ if (d->ref.isShared() || (d->offset != sizeof(QStringData))) realloc(); } +{ if (d->ref.isShared() || (d->offset != sizeof(QStringData))) realloc(d->size); } inline bool QString::isDetached() const { return !d->ref.isShared(); } inline QString &QString::operator=(const QLatin1String &s) @@ -925,7 +924,7 @@ inline void QString::reserve(int asize) inline void QString::squeeze() { if (d->ref.isShared() || d->size < int(d->alloc)) - realloc(); + realloc(d->size); if (d->capacityReserved) { // cannot set unconditionally, since d could be shared_null or |