diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2010-02-16 15:22:20 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2010-02-17 10:21:43 (GMT) |
commit | da17f57b058d39b82de1a21d8d6203004b22a063 (patch) | |
tree | 8ec6343728bbf5d67c03907bcf5cc62157ddad01 /src/network/access | |
parent | ff7d6e1bf004495167623fae8c97eddf2df46983 (diff) | |
download | Qt-da17f57b058d39b82de1a21d8d6203004b22a063.zip Qt-da17f57b058d39b82de1a21d8d6203004b22a063.tar.gz Qt-da17f57b058d39b82de1a21d8d6203004b22a063.tar.bz2 |
QNAM HTTP: Trivial optimization
Reorder switch.
Directly return instead of having a null QByteArray, using append
and then returning it.
Reviewed-by: Peter Hartmann
Diffstat (limited to 'src/network/access')
-rw-r--r-- | src/network/access/qhttpnetworkrequest.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/network/access/qhttpnetworkrequest.cpp b/src/network/access/qhttpnetworkrequest.cpp index 645deb8..302c91b 100644 --- a/src/network/access/qhttpnetworkrequest.cpp +++ b/src/network/access/qhttpnetworkrequest.cpp @@ -77,39 +77,38 @@ bool QHttpNetworkRequestPrivate::operator==(const QHttpNetworkRequestPrivate &ot QByteArray QHttpNetworkRequestPrivate::methodName() const { - QByteArray ba; switch (operation) { - case QHttpNetworkRequest::Options: - ba += "OPTIONS"; - break; case QHttpNetworkRequest::Get: - ba += "GET"; + return "GET"; break; case QHttpNetworkRequest::Head: - ba += "HEAD"; + return "HEAD"; break; case QHttpNetworkRequest::Post: - ba += "POST"; + return "POST"; + break; + case QHttpNetworkRequest::Options: + return "OPTIONS"; break; case QHttpNetworkRequest::Put: - ba += "PUT"; + return "PUT"; break; case QHttpNetworkRequest::Delete: - ba += "DELETE"; + return "DELETE"; break; case QHttpNetworkRequest::Trace: - ba += "TRACE"; + return "TRACE"; break; case QHttpNetworkRequest::Connect: - ba += "CONNECT"; + return "CONNECT"; break; case QHttpNetworkRequest::Custom: - ba += customVerb; + return customVerb; break; default: break; } - return ba; + return QByteArray(); } QByteArray QHttpNetworkRequestPrivate::uri(bool throughProxy) const |