summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-04-29 15:50:11 +0300
committerAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-05-09 18:57:57 +0000
commit7abb90a70aed97c665430eb1e9f174dce26addd4 (patch)
tree7f081d05a95721f50a3c876cf069fbb28d300fc4 /src/corelib
parentc906d7abb84e60d2d4b66edce712cb32b3ce4470 (diff)
QDateTimeParser: proper construction of QString
... with known size and known char by corresponding ctor. Don't use fill() for this case. Change-Id: I475a0655132ecbb40b1eac919309597b2560e71b Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qdatetimeparser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp
index fbf91fe8a4..9b0f293d59 100644
--- a/src/corelib/tools/qdatetimeparser.cpp
+++ b/src/corelib/tools/qdatetimeparser.cpp
@@ -847,7 +847,7 @@ int QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionInde
if (skipToNextSection(sectionIndex, currentValue, digitsStr)) {
state = Acceptable;
const int missingZeroes = sectionmaxsize - digitsStr.size();
- text.insert(index, QString().fill(QLatin1Char('0'), missingZeroes));
+ text.insert(index, QString(missingZeroes, QLatin1Char('0')));
used = sectionmaxsize;
cursorPosition += missingZeroes;
++(const_cast<QDateTimeParser*>(this)->sectionNodes[sectionIndex].zeroesAdded);