Skip to content

Commit a5f084b

Browse files
authored
Merge pull request #160 from patchkit-net/bugfix/v3.17.x.x/shorten-file-path-unpacking
Refactoring v3.17.7.0-rc1
2 parents 31e9ee5 + 481875a commit a5f084b

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Assets/PatchKit Patcher/Scripts/AppData/Local/Pack1Unarchiver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private Pack1Unarchiver(string packagePath, Pack1Meta metaData, string destinati
6868
Checks.ArgumentFileExists(packagePath, "packagePath");
6969
Checks.ArgumentDirectoryExists(destinationDirPath, "destinationDirPath");
7070
Checks.ArgumentNotNull(suffix, "suffix");
71-
Assert.IsNotNull(mapHashExtractedFiles);
71+
Checks.ArgumentNotNull(mapHashExtractedFiles, "mapHashExtractedFiles");
7272

7373
if (range.Start == 0)
7474
{

Assets/PatchKit Patcher/Scripts/AppData/Local/ZipUnarchiver.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public ZipUnarchiver(string packagePath, string destinationDirPath, MapHashExtra
3131
{
3232
Checks.ArgumentFileExists(packagePath, "packagePath");
3333
Checks.ArgumentDirectoryExists(destinationDirPath, "destinationDirPath");
34-
Assert.IsNotNull(mapHashExtractedFiles);
34+
Checks.ArgumentNotNull(mapHashExtractedFiles, "mapHashExtractedFiles");
3535

3636
DebugLogger.LogConstructor();
3737
DebugLogger.LogVariable(packagePath, "packagePath");
@@ -73,12 +73,10 @@ public void Unarchive(CancellationToken cancellationToken)
7373
private void UnarchiveEntry(ZipEntry zipEntry)
7474
{
7575
DebugLogger.Log(string.Format("Unarchiving entry {0}", zipEntry.FileName));
76-
MemoryStream memoryStream = new MemoryStream();
7776
string destPath = Path.Combine(_destinationDirPath, _mapHashExtractedFiles.Add(zipEntry.FileName));
78-
zipEntry.Extract(memoryStream);
7977
using (var target = new FileStream(destPath, FileMode.Create))
8078
{
81-
memoryStream.WriteTo(target);
79+
zipEntry.Extract(target);
8280
}
8381
}
8482

0 commit comments

Comments
 (0)