mirror of
https://github.com/crskycode/GARbro.git
synced 2025-01-12 04:49:32 +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
|
try
|
||||||
{
|
{
|
||||||
uint signature = file.View.ReadUInt32 (0);
|
uint signature = file.View.ReadUInt32 (0);
|
||||||
|
var tried = new HashSet<ArchiveFormat>();
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
var range = FormatCatalog.Instance.LookupSignature<ArchiveFormat> (signature);
|
var range = FormatCatalog.Instance.LookupSignature<ArchiveFormat> (signature);
|
||||||
@ -80,6 +81,8 @@ namespace GameRes
|
|||||||
range = range.OrderByDescending (f => f.Extensions.Any (e => e == ext.Value));
|
range = range.OrderByDescending (f => f.Extensions.Any (e => e == ext.Value));
|
||||||
foreach (var impl in range)
|
foreach (var impl in range)
|
||||||
{
|
{
|
||||||
|
if (!tried.Add (impl))
|
||||||
|
continue;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var arc = impl.TryOpen (file);
|
var arc = impl.TryOpen (file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user