QProcess/Unix: remove redundant checks in waitForReadyRead()
QProcessPrivate::tryReadFromChannel() returns 'true' only if we emitted readyRead() signal on the current read channel. Thus, these additional checks are unnecessary. Change-Id: Id98620cd08ee8808f60539c009986b869e517ef0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
This commit is contained in:
parent
97abbf3f1f
commit
6e07edb260
@ -749,17 +749,14 @@ bool QProcessPrivate::waitForReadyRead(int msecs)
|
||||
return false;
|
||||
}
|
||||
|
||||
// This calls QProcessPrivate::tryReadFromChannel(), which returns true
|
||||
// if we emitted readyRead() signal on the current read channel.
|
||||
bool readyReadEmitted = false;
|
||||
if (qt_pollfd_check(poller.stdoutPipe(), POLLIN)) {
|
||||
bool canRead = _q_canReadStandardOutput();
|
||||
if (currentReadChannel == QProcess::StandardOutput && canRead)
|
||||
readyReadEmitted = true;
|
||||
}
|
||||
if (qt_pollfd_check(poller.stderrPipe(), POLLIN)) {
|
||||
bool canRead = _q_canReadStandardError();
|
||||
if (currentReadChannel == QProcess::StandardError && canRead)
|
||||
readyReadEmitted = true;
|
||||
}
|
||||
if (qt_pollfd_check(poller.stdoutPipe(), POLLIN) && _q_canReadStandardOutput())
|
||||
readyReadEmitted = true;
|
||||
if (qt_pollfd_check(poller.stderrPipe(), POLLIN) && _q_canReadStandardError())
|
||||
readyReadEmitted = true;
|
||||
|
||||
if (readyReadEmitted)
|
||||
return true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user