OSDN Git Service
(root)
/
kde
/
Katie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f2ef4c
)
avoid two character lookups in qIsEffectiveTLD() function
author
Ivailo Monev
<xakepa10@laimg.moc>
Tue, 26 Nov 2019 18:20:58 +0000
(18:20 +0000)
committer
Ivailo Monev
<xakepa10@laimg.moc>
Tue, 26 Nov 2019 18:20:58 +0000
(18:20 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/core/io/qtldurl.cpp
patch
|
blob
|
history
diff --git
a/src/core/io/qtldurl.cpp
b/src/core/io/qtldurl.cpp
index
ca160db
..
81e0ee4
100644
(file)
--- a/
src/core/io/qtldurl.cpp
+++ b/
src/core/io/qtldurl.cpp
@@
-84,8
+84,9
@@
Q_CORE_EXPORT bool qIsEffectiveTLD(const QString &domain)
if (containsTLDEntry(domain))
return true;
- if (domain.contains(QLatin1Char('.'))) {
- int count = domain.size() - domain.indexOf(QLatin1Char('.'));
+ const int dotindex = domain.indexOf(QLatin1Char('.'));
+ if (dotindex > 0) {
+ int count = (domain.size() - dotindex);
QString wildCardDomain;
wildCardDomain.reserve(count + 1);
wildCardDomain.append(QLatin1Char('*'));