diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2020-04-23 18:05:49 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2020-05-05 18:58:56 +0200 |
commit | 1978bfa69a3210de285843c1e977f1068e94ca42 (patch) | |
tree | 6003d4884aa8ba00c6dfd7f9f3d2ba2924543559 /src/corelib/io/qurlidna.cpp | |
parent | 636a6aece02efb45fdd86c64b5607fd9bb798839 (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.cpp | 10 |
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; } } |