summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qurlidna.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2020-04-23 18:05:49 +0200
committerMarc Mutz <marc.mutz@kdab.com>2020-05-05 18:58:56 +0200
commit1978bfa69a3210de285843c1e977f1068e94ca42 (patch)
tree6003d4884aa8ba00c6dfd7f9f3d2ba2924543559 /src/corelib/io/qurlidna.cpp
parent636a6aece02efb45fdd86c64b5607fd9bb798839 (diff)
QUrlIdna: simplify a loop using QStringView::mid()
Change-Id: I0f33a29b3104ceac4c5dfb9db2bfdcd896bb95d1 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/io/qurlidna.cpp')
-rw-r--r--src/corelib/io/qurlidna.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp
index 4aa16aaa71..f5ba691d72 100644
--- a/src/corelib/io/qurlidna.cpp
+++ b/src/corelib/io/qurlidna.cpp
@@ -2525,16 +2525,14 @@ QString qt_ACE_do(QStringView domain, AceOperation op, AceLeadingDot dot)
result.resize(prevLen + labelLength);
{
QChar *out = result.data() + prevLen;
- const QChar *in = domain.data() + lastIdx;
- const QChar *e = in + labelLength;
- for (; in < e; ++in, ++out) {
- ushort uc = in->unicode();
+ for (QChar c : domain.mid(lastIdx, labelLength)) {
+ const auto uc = c.unicode();
if (uc > 0x7f)
simple = false;
if (uc >= 'A' && uc <= 'Z')
- *out = QChar(uc | 0x20);
+ *out++ = QChar(uc | 0x20);
else
- *out = *in;
+ *out++ = c;
}
}