From b653b29ceeb97677e9a8c05afe3c0ca8eacd432b Mon Sep 17 00:00:00 2001 From: "quan.z" Date: Fri, 15 Dec 2023 10:10:47 +0800 Subject: [PATCH] Update AliyunpanDownloader.swift (#18) fix updateNetworkSpeed bug, change 'min' to 'max' --- Sources/AliyunpanSDK/HTTPRequest/AliyunpanDownloader.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/AliyunpanSDK/HTTPRequest/AliyunpanDownloader.swift b/Sources/AliyunpanSDK/HTTPRequest/AliyunpanDownloader.swift index 7727915..b9ea46c 100644 --- a/Sources/AliyunpanSDK/HTTPRequest/AliyunpanDownloader.swift +++ b/Sources/AliyunpanSDK/HTTPRequest/AliyunpanDownloader.swift @@ -182,7 +182,7 @@ public class AliyunpanDownloader: NSObject { } @objc private func updateNetworkSpeed() { - let offset = min(totalWritedSize - lastTotalWritedSize, 0) + let offset = max(totalWritedSize - lastTotalWritedSize, 0) networkSpeedMonitor?(offset) lastTotalWritedSize = totalWritedSize }