QString: rename parameter clashing with member function of the same name

The size parameter shadows the size() member function, so rename it to
newSize.

Prepares for a follow-up change that ports from count()/length() to
size().

Change-Id: I0ca8af57d6351f85a568409a8d02b66371bb05e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e1d21fe813c4c9c3f53e59c08190f80b38e385da)
This commit is contained in:
Marc Mutz 2022-10-09 11:05:42 +02:00
parent 04f6f4afa9
commit 4fd2c8fe1d

View File

@ -2652,10 +2652,10 @@ void QString::resize(qsizetype size)
\snippet qstring/main.cpp 46
*/
void QString::resize(qsizetype size, QChar fillChar)
void QString::resize(qsizetype newSize, QChar fillChar)
{
const qsizetype oldSize = length();
resize(size);
resize(newSize);
const qsizetype difference = length() - oldSize;
if (difference > 0)
std::fill_n(d.data() + oldSize, difference, fillChar.unicode());