diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-09-20 15:59:46 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-02 22:34:42 +0200 |
commit | 9bbccf5d746542a0a17198476f60a70f731ac536 (patch) | |
tree | ea7976f7a8bb165a47ab85fa35caef7afdeb7472 | |
parent | ceca141d0cfb210859db28c8f7725790fe23a767 (diff) |
Change QUrlPrivate::setAuthority to return void
It used to return bool because setHost returns bool and, therefore,
setAuthority could fail. However, the return value is never checked,
in either parse() or QUrl::setAuthority(), because there's no error
recovery.
This is a small optimisation.
Change-Id: I25660d66cfad64ca5b9706cc38afa0e97ba3ee0b
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: David Faure <faure@kde.org>
-rw-r--r-- | src/corelib/io/qurl.cpp | 6 | ||||
-rw-r--r-- | src/corelib/io/qurl_p.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index e78d810bdb..4cedb848fc 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -709,7 +709,7 @@ bool QUrlPrivate::setScheme(const QString &value, int len) return true; } -bool QUrlPrivate::setAuthority(const QString &auth, int from, int end, QUrl::ParsingMode mode) +inline void QUrlPrivate::setAuthority(const QString &auth, int from, int end, QUrl::ParsingMode mode) { sectionHasError &= ~Authority; sectionIsPresent &= ~Authority; @@ -719,7 +719,7 @@ bool QUrlPrivate::setAuthority(const QString &auth, int from, int end, QUrl::Par password.clear(); host.clear(); port = -1; - return true; + return; } int userInfoIndex = auth.indexOf(QLatin1Char('@'), from); @@ -769,7 +769,7 @@ bool QUrlPrivate::setAuthority(const QString &auth, int from, int end, QUrl::Par port = -1; } - return setHost(auth, from, qMin<uint>(end, colonIndex), mode) && !(sectionHasError & Port); + setHost(auth, from, qMin<uint>(end, colonIndex), mode); } void QUrlPrivate::setUserInfo(const QString &userInfo, int from, int end) diff --git a/src/corelib/io/qurl_p.h b/src/corelib/io/qurl_p.h index 12ab0c763d..780fb387d9 100644 --- a/src/corelib/io/qurl_p.h +++ b/src/corelib/io/qurl_p.h @@ -127,7 +127,7 @@ public: // the "end" parameters are like STL iterators: they point to one past the last valid element bool setScheme(const QString &value, int len); - bool setAuthority(const QString &auth, int from, int end, QUrl::ParsingMode mode); + void setAuthority(const QString &auth, int from, int end, QUrl::ParsingMode mode); void setUserInfo(const QString &userInfo, int from, int end); void setUserName(const QString &value, int from, int end); void setPassword(const QString &value, int from, int end); |