Skip to content

Commit ec946bd

Browse files
committed
fix race condition in GetPoorlyCompressedExtensions
1 parent b7b5857 commit ec946bd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

CompactGUI.Core/Analyser.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ await Task.Run(() =>
9797
CompressedBytes = fl.CompressedSize,
9898
UncompressedBytes = fl.UncompressedSize
9999
},
100-
(key, existing) =>
100+
(key, existing) => new ExtensionResult
101101
{
102-
existing.TotalFiles++;
103-
existing.CompressedBytes += fl.CompressedSize;
104-
existing.UncompressedBytes += fl.UncompressedSize;
105-
return existing;
102+
Extension = ext,
103+
TotalFiles = existing.TotalFiles + 1,
104+
CompressedBytes = existing.CompressedBytes + fl.CompressedSize,
105+
UncompressedBytes = existing.UncompressedBytes + fl.UncompressedSize
106106
});
107107
});
108108
});

0 commit comments

Comments
 (0)