mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 20:04:13 +08:00
(ArcFile.TryOpen): don't try same format twice.
This commit is contained in:
parent
9cf0c88b59
commit
394a7949dd
@ -72,6 +72,7 @@ namespace GameRes
|
||||
try
|
||||
{
|
||||
uint signature = file.View.ReadUInt32 (0);
|
||||
var tried = new HashSet<ArchiveFormat>();
|
||||
for (;;)
|
||||
{
|
||||
var range = FormatCatalog.Instance.LookupSignature<ArchiveFormat> (signature);
|
||||
@ -80,6 +81,8 @@ namespace GameRes
|
||||
range = range.OrderByDescending (f => f.Extensions.Any (e => e == ext.Value));
|
||||
foreach (var impl in range)
|
||||
{
|
||||
if (!tried.Add (impl))
|
||||
continue;
|
||||
try
|
||||
{
|
||||
var arc = impl.TryOpen (file);
|
||||
|
Loading…
x
Reference in New Issue
Block a user