diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index 01571e3e9f..b240f8d450 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -192,7 +192,7 @@ public: inline void append(const T &t) { if (s == a) { // i.e. s != 0 T copy(t); - realloc(s, s<<1); + reallocate(s, s << 1); const qsizetype idx = s++; if (QTypeInfo::isComplex) { new (ptr + idx) T(std::move(copy)); @@ -211,7 +211,7 @@ public: void append(T &&t) { if (s == a) - realloc(s, s << 1); + reallocate(s, s << 1); const qsizetype idx = s++; if (QTypeInfo::isComplex) new (ptr + idx) T(std::move(t)); @@ -288,7 +288,7 @@ public: void shrink_to_fit() { squeeze(); } private: - void realloc(qsizetype size, qsizetype alloc); + void reallocate(qsizetype size, qsizetype alloc); qsizetype a; // capacity qsizetype s; // size @@ -331,11 +331,11 @@ Q_INLINE_TEMPLATE QVarLengthArray::QVarLengthArray(qsizetype asize) template Q_INLINE_TEMPLATE void QVarLengthArray::resize(qsizetype asize) -{ realloc(asize, qMax(asize, a)); } +{ reallocate(asize, qMax(asize, a)); } template Q_INLINE_TEMPLATE void QVarLengthArray::reserve(qsizetype asize) -{ if (asize > a) realloc(s, asize); } +{ if (asize > a) reallocate(s, asize); } template Q_INLINE_TEMPLATE qsizetype QVarLengthArray::indexOf(const T &t, qsizetype from) const @@ -392,7 +392,7 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray::append(const T *abuf, qs const qsizetype asize = s + increment; if (asize >= a) - realloc(s, qMax(s*2, asize)); + reallocate(s, qMax(s * 2, asize)); if (QTypeInfo::isComplex) { // call constructor for new objects (which can throw) @@ -406,10 +406,10 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray::append(const T *abuf, qs template Q_INLINE_TEMPLATE void QVarLengthArray::squeeze() -{ realloc(s, s); } +{ reallocate(s, s); } template -Q_OUTOFLINE_TEMPLATE void QVarLengthArray::realloc(qsizetype asize, qsizetype aalloc) +Q_OUTOFLINE_TEMPLATE void QVarLengthArray::reallocate(qsizetype asize, qsizetype aalloc) { Q_ASSERT(aalloc >= asize); T *oldPtr = ptr;