summaryrefslogtreecommitdiffstats
path: root/src/corelib/text
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-08-24 11:46:24 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-08-26 01:09:14 +0200
commit75cd9c13c2c6130d51ccacd7f1247bdc2628e4b3 (patch)
tree9233717ad862ac9b718352ae5cc50921184627e3 /src/corelib/text
parent049d8892eaa18d71d6edb10752418ad33305f310 (diff)
QRegularExpression: code tidies
Given QList-is-QVector, remove an historical piece of code. Change-Id: I7a8876be8ade6dbaa1822d773b092ddb3c4182d4 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text')
-rw-r--r--src/corelib/text/qregularexpression.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/corelib/text/qregularexpression.cpp b/src/corelib/text/qregularexpression.cpp
index a0b35f8142..dc6c1987c9 100644
--- a/src/corelib/text/qregularexpression.cpp
+++ b/src/corelib/text/qregularexpression.cpp
@@ -1488,12 +1488,8 @@ QStringList QRegularExpression::namedCaptureGroups() const
pcre2_pattern_info_16(d->compiledPattern, PCRE2_INFO_NAMECOUNT, &namedCapturingTableEntryCount);
pcre2_pattern_info_16(d->compiledPattern, PCRE2_INFO_NAMEENTRYSIZE, &namedCapturingTableEntrySize);
- QStringList result;
-
- // no QList::resize nor fill is available. The +1 is for the implicit group #0
- result.reserve(d->capturingCount + 1);
- for (int i = 0; i < d->capturingCount + 1; ++i)
- result.append(QString());
+ // The +1 is for the implicit group #0
+ QStringList result(d->capturingCount + 1);
for (unsigned int i = 0; i < namedCapturingTableEntryCount; ++i) {
const auto currentNamedCapturingTableRow =