diff options
author | Florian Bruhin <git@the-compiler.org> | 2015-03-04 07:38:24 +0100 |
---|---|---|
committer | Florian Bruhin <qt-project.org@the-compiler.org> | 2015-03-05 10:57:32 +0000 |
commit | c4c895d2dd483ad6972bd6ec4f7792550f281e93 (patch) | |
tree | 56e572dddb3a0677a66fef097d87acc4546bcb79 /src/network/access | |
parent | 983bdc0713fc5204c5b5e5d921b2cc2caf59147a (diff) |
Remove unneeded check in QNetworkReplyImpl::abort.
QNetworkReplyImpl::abort immediately returns at the beginning of the function
when the state is already finished, and the state does not get changed by the
code in between - so this condition will always be true.
Change-Id: Ia98df7cbecf471c7236b5e17caddd1301b647d2b
Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
Diffstat (limited to 'src/network/access')
-rw-r--r-- | src/network/access/qnetworkreplyimpl.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index bcfa48e666..be1adfbee1 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -923,13 +923,11 @@ void QNetworkReplyImpl::abort() QNetworkReply::close(); - if (d->state != QNetworkReplyPrivate::Finished) { - // call finished which will emit signals - d->error(OperationCanceledError, tr("Operation canceled")); - if (d->state == QNetworkReplyPrivate::WaitingForSession) - d->state = QNetworkReplyPrivate::Working; - d->finished(); - } + // call finished which will emit signals + d->error(OperationCanceledError, tr("Operation canceled")); + if (d->state == QNetworkReplyPrivate::WaitingForSession) + d->state = QNetworkReplyPrivate::Working; + d->finished(); d->state = QNetworkReplyPrivate::Aborted; // finished may access the backend |