From fdfb69603601195d9e90dfb4ad0135f7df582b78 Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 8 Oct 2024 17:29:00 +0900 Subject: [PATCH] Update FileSizeCalculator.cs --- .../Storage/Operations/FileSizeCalculator.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Files.App/Utils/Storage/Operations/FileSizeCalculator.cs b/src/Files.App/Utils/Storage/Operations/FileSizeCalculator.cs index 913644a16b33..302a8fbd822d 100644 --- a/src/Files.App/Utils/Storage/Operations/FileSizeCalculator.cs +++ b/src/Files.App/Utils/Storage/Operations/FileSizeCalculator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Files Community +// Copyright (c) 2024 Files Community // Licensed under the MIT License. See the LICENSE. using System.Collections.Concurrent; @@ -25,13 +25,16 @@ public FileSizeCalculator(params string[] paths) public async Task ComputeSizeAsync(CancellationToken cancellationToken = default) { - await Parallel.ForEachAsync(_paths, cancellationToken, async (path, token) => await Task.Factory.StartNew(() => - { - ComputeSizeRecursively(path, token); - }, - token, - TaskCreationOptions.LongRunning, - TaskScheduler.Default)); + await Parallel.ForEachAsync( + _paths, + cancellationToken, + async (path, token) => await Task.Factory.StartNew(() => + { + ComputeSizeRecursively(path, token); + }, + token, + TaskCreationOptions.LongRunning, + TaskScheduler.Default)); unsafe void ComputeSizeRecursively(string path, CancellationToken token) {