reduce linq usage for download transferred bytes
This commit is contained in:
		| @@ -3,7 +3,7 @@ | |||||||
|   <PropertyGroup> |   <PropertyGroup> | ||||||
|     <Authors></Authors> |     <Authors></Authors> | ||||||
|     <Company></Company> |     <Company></Company> | ||||||
|     <Version>0.5.10</Version> |     <Version>0.5.11</Version> | ||||||
|     <Description></Description> |     <Description></Description> | ||||||
|     <Copyright></Copyright> |     <Copyright></Copyright> | ||||||
|     <PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl> |     <PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl> | ||||||
|   | |||||||
| @@ -120,10 +120,7 @@ public partial class ApiController | |||||||
|             var hash = file.Hash; |             var hash = file.Hash; | ||||||
|             Progress<long> progress = new((bytesDownloaded) => |             Progress<long> progress = new((bytesDownloaded) => | ||||||
|             { |             { | ||||||
|                 if (!CurrentDownloads.TryGetValue(currentDownloadId, out var downloads)) return; |                 file.Transferred += bytesDownloaded; | ||||||
|  |  | ||||||
|                 var download = downloads.FirstOrDefault(f => string.Equals(f.Hash, hash, StringComparison.OrdinalIgnoreCase)); |  | ||||||
|                 if (download != null) download.Transferred += bytesDownloaded; |  | ||||||
|             }); |             }); | ||||||
|  |  | ||||||
|             var tempFile = await DownloadFileHttpClient(file.DownloadUri, progress, token).ConfigureAwait(false); |             var tempFile = await DownloadFileHttpClient(file.DownloadUri, progress, token).ConfigureAwait(false); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 rootdarkarchon
					rootdarkarchon