@@ -1358,13 +1358,7 @@ internal static ValueTask<FileStream> NaivelyOpenFileStreamAsync(FileInfo info,
13581358#if USENEWZIPDECOMPRESS
13591359 protected virtual long GetArchiveUncompressedSizeManaged ( Stream archiveStream )
13601360 {
1361- ZipArchiveReader archive = ZipArchiveReader
1362- . CreateFrom ( ( pos , _ ) =>
1363- {
1364- archiveStream . Position = pos ?? 0 ;
1365- return archiveStream ;
1366- } ) ;
1367-
1361+ ZipArchiveReader archive = ZipArchiveReader . CreateFrom ( archiveStream ) ;
13681362 return archive . Sum ( x => x . Size ) ;
13691363 }
13701364#endif
@@ -1385,26 +1379,22 @@ protected virtual long GetSingleOrSegmentedUncompressedSize(GameInstallPackage a
13851379 using Stream stream = GetSingleOrSegmentedDownloadStream ( asset ) ;
13861380
13871381#if USENEWZIPDECOMPRESS
1388- Func < Stream , long > summaryDelegate ;
13891382 if ( LauncherConfig . IsEnforceToUse7zipOnExtract )
13901383 {
1391- summaryDelegate = GetArchiveUncompressedSizeNative7Zip ;
1392- }
1393- else if ( ( asset . PathOutput . EndsWith ( ".zip" , StringComparison . OrdinalIgnoreCase ) ||
1394- asset . PathOutput . EndsWith ( ".zip.001" , StringComparison . OrdinalIgnoreCase ) ) &&
1395- ! IsAllowExtractCorruptZip )
1396- {
1397- summaryDelegate = GetArchiveUncompressedSizeManaged ;
1384+ return GetArchiveUncompressedSizeNative7Zip ( stream ) ;
13981385 }
1399- else
1386+
1387+ if ( ( asset . PathOutput . EndsWith ( ".zip" , StringComparison . OrdinalIgnoreCase ) ||
1388+ asset . PathOutput . EndsWith ( ".zip.001" , StringComparison . OrdinalIgnoreCase ) ) &&
1389+ ! IsAllowExtractCorruptZip )
14001390 {
1401- summaryDelegate = GetArchiveUncompressedSizeNative7Zip ;
1391+ return GetArchiveUncompressedSizeManaged ( stream ) ;
14021392 }
1393+
1394+ return GetArchiveUncompressedSizeNative7Zip ( stream ) ;
14031395#else
14041396 return GetArchiveUncompressedSizeNative7Zip ( stream ) ;
14051397#endif
1406-
1407- return summaryDelegate ( stream ) ;
14081398 }
14091399
14101400 protected virtual Stream GetSingleOrSegmentedDownloadStream ( GameInstallPackage asset )
0 commit comments