Order of operations

This commit is contained in:
Matt Nadareski
2025-08-26 06:52:47 -04:00
parent 3a62bfab57
commit 838afc35c3
3 changed files with 15 additions and 15 deletions

View File

@@ -105,13 +105,13 @@ namespace SabreTools.Serialization.Wrappers
{
// Find all file parts
FileInfo[] parts = [.. ArchiveFactory.GetFileParts(new FileInfo(Filename))];
// If there are multiple parts
if (parts.Length > 1)
zipFile = ZipArchive.Open(parts, readerOptions);
// Try to read the file path if no entries are found
if (zipFile.Entries.Count == 0)
zipFile = ZipArchive.Open(parts, readerOptions);
// If there's any multipart items, try reading the file as well
else if (parts.Length > 1)
else if (zipFile.Entries.Count == 0)
zipFile = ZipArchive.Open(parts, readerOptions);
}

View File

@@ -108,13 +108,13 @@ namespace SabreTools.Serialization.Wrappers
{
// Find all file parts
FileInfo[] parts = [.. ArchiveFactory.GetFileParts(new FileInfo(Filename))];
// If there are multiple parts
if (parts.Length > 1)
rarFile = RarArchive.Open(parts, readerOptions);
// Try to read the file path if no entries are found
if (rarFile.Entries.Count == 0)
rarFile = RarArchive.Open(parts, readerOptions);
// If there's any multipart items, try reading the file as well
else if (parts.Length > 1)
else if (rarFile.Entries.Count == 0)
rarFile = RarArchive.Open(parts, readerOptions);
}

View File

@@ -108,13 +108,13 @@ namespace SabreTools.Serialization.Wrappers
{
// Find all file parts
FileInfo[] parts = [.. ArchiveFactory.GetFileParts(new FileInfo(Filename))];
// If there are multiple parts
if (parts.Length > 1)
sevenZip = SevenZipArchive.Open(parts, readerOptions);
// Try to read the file path if no entries are found
if (sevenZip.Entries.Count == 0)
sevenZip = SevenZipArchive.Open(parts, readerOptions);
// If there's any multipart items, try reading the file as well
else if (parts.Length > 1)
else if (sevenZip.Entries.Count == 0)
sevenZip = SevenZipArchive.Open(parts, readerOptions);
}