diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2020-05-12 10:11:09 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2020-05-13 15:23:06 +0200 |
commit | 1f7eb3332e4e1567918cf2b12f3119d23795e9ac (patch) | |
tree | 292ca9aff27f848e6c29941153e2a26e527812f6 /src/corelib/io | |
parent | a504f63f2ebd3aa62a7d1c4087a0620b1c38758b (diff) |
QUrlIdna: replace manual pointer handling with std::begin()/end()
This is more readable, because it follows usual iterator patterns.
Change-Id: I56900286ddbca57a86aa499020f175e8add17fd9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/io')
-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 08c5d1759c..549b280f91 100644 --- a/src/corelib/io/qurlidna.cpp +++ b/src/corelib/io/qurlidna.cpp @@ -1442,8 +1442,6 @@ static const NameprepCaseFoldingEntry NameprepCaseFolding[] = { static void mapToLowerCase(QString *str, int from) { - int N = sizeof(NameprepCaseFolding) / sizeof(NameprepCaseFolding[0]); - ushort *d = nullptr; for (int i = from; i < str->size(); ++i) { uint uc = str->at(i).unicode(); @@ -1461,10 +1459,10 @@ static void mapToLowerCase(QString *str, int from) ++i; } } - const NameprepCaseFoldingEntry *entry = std::lower_bound(NameprepCaseFolding, - NameprepCaseFolding + N, - uc); - if ((entry != NameprepCaseFolding + N) && !(uc < *entry)) { + const auto entry = std::lower_bound(std::begin(NameprepCaseFolding), + std::end(NameprepCaseFolding), + uc); + if ((entry != std::end(NameprepCaseFolding)) && !(uc < *entry)) { int l = 1; while (l < 4 && entry->mapping[l]) ++l; |