Skip to content

Commit

Permalink
Remove unused variable
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed Jan 3, 2024
1 parent e1d5486 commit 6340653
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions ValvePak/ValvePak/Package.Verify.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,34 +167,21 @@ public void VerifyChunkHashes(IProgress<string> progressReporter = null)
/// <param name="progressReporter">If provided, will report a string with the current verification progress.</param>
public void VerifyFileChecksums(IProgress<string> progressReporter = null)
{
Stream stream = null;
var lastArchiveIndex = uint.MaxValue;

var allEntries = Entries
.SelectMany(file => file.Value)
.OrderBy(file => file.Offset)
.GroupBy(file => file.ArchiveIndex)
.OrderBy(x => x.Key)
.SelectMany(x => x);

try
foreach (var entry in allEntries)
{
foreach (var entry in allEntries)
{
progressReporter?.Report($"Verifying CRC32 checksum for '{entry.GetFullPath()}' in archive {entry.ArchiveIndex}.");

ReadEntry(entry, out var _, validateCrc: true);
}
progressReporter?.Report($"Verifying CRC32 checksum for '{entry.GetFullPath()}' in archive {entry.ArchiveIndex}.");

progressReporter?.Report("Successfully verified file CRC32 checksums.");
}
finally
{
if (lastArchiveIndex != 0x7FFF)
{
stream?.Close();
}
ReadEntry(entry, out var _, validateCrc: true);
}

progressReporter?.Report("Successfully verified file CRC32 checksums.");
}

/// <summary>
Expand Down

0 comments on commit 6340653

Please sign in to comment.