mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Replaced snap util function with std::clamp.
This commit is contained in:
@@ -1073,7 +1073,10 @@ void SessionPrivate::onSentSome(uint64 size) {
|
||||
if (!_oldConnection) {
|
||||
// 8kb / sec, so 512 kb give 64 sec
|
||||
auto remainBySize = size * _waitForReceived / 8192;
|
||||
remain = snap(remainBySize, remain, uint64(kMaxReceiveTimeout));
|
||||
remain = std::clamp(
|
||||
remainBySize,
|
||||
remain,
|
||||
uint64(kMaxReceiveTimeout));
|
||||
if (remain != _waitForReceived) {
|
||||
DEBUG_LOG(("Checking connect for request with size %1 bytes, delay will be %2").arg(size).arg(remain));
|
||||
}
|
||||
|
Reference in New Issue
Block a user