QAbstractSocket: remove a redundant stack variable

Just use the static const int directly.

Change-Id: Icf37ac5db4457bbc8631659e175d038cfeed46e4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
bb10
Ahmad Samir 2023-07-26 16:23:10 +03:00
parent 8ed2bc9194
commit 7fe1198f6e
1 changed files with 3 additions and 5 deletions

View File

@ -1057,8 +1057,7 @@ void QAbstractSocketPrivate::_q_connectToNextAddress()
q, SLOT(_q_abortConnectionAttempt()),
Qt::DirectConnection);
}
int connectTimeout = DefaultConnectTimeout;
connectTimer->start(connectTimeout);
connectTimer->start(DefaultConnectTimeout);
}
// Wait for a write notification that will eventually call
@ -2073,15 +2072,14 @@ bool QAbstractSocket::waitForConnected(int msecs)
if (state() == UnconnectedState)
return false; // connect not im progress anymore!
int connectTimeout = DefaultConnectTimeout;
bool timedOut = true;
#if defined (QABSTRACTSOCKET_DEBUG)
int attempt = 1;
#endif
while (state() == ConnectingState && (msecs == -1 || stopWatch.elapsed() < msecs)) {
int timeout = qt_subtract_from_timeout(msecs, stopWatch.elapsed());
if (msecs != -1 && timeout > connectTimeout)
timeout = connectTimeout;
if (msecs != -1 && timeout > DefaultConnectTimeout)
timeout = DefaultConnectTimeout;
#if defined (QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocket::waitForConnected(%i) waiting %.2f secs for connection attempt #%i",
msecs, timeout / 1000.0, attempt++);