Skip to content

Commit fdfb696

Browse files
authored
Update FileSizeCalculator.cs
1 parent ad153fa commit fdfb696

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/Files.App/Utils/Storage/Operations/FileSizeCalculator.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2024 Files Community
1+
// Copyright (c) 2024 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

44
using System.Collections.Concurrent;
@@ -25,13 +25,16 @@ public FileSizeCalculator(params string[] paths)
2525

2626
public async Task ComputeSizeAsync(CancellationToken cancellationToken = default)
2727
{
28-
await Parallel.ForEachAsync(_paths, cancellationToken, async (path, token) => await Task.Factory.StartNew(() =>
29-
{
30-
ComputeSizeRecursively(path, token);
31-
},
32-
token,
33-
TaskCreationOptions.LongRunning,
34-
TaskScheduler.Default));
28+
await Parallel.ForEachAsync(
29+
_paths,
30+
cancellationToken,
31+
async (path, token) => await Task.Factory.StartNew(() =>
32+
{
33+
ComputeSizeRecursively(path, token);
34+
},
35+
token,
36+
TaskCreationOptions.LongRunning,
37+
TaskScheduler.Default));
3538

3639
unsafe void ComputeSizeRecursively(string path, CancellationToken token)
3740
{

0 commit comments

Comments
 (0)