mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
use HasExtension method instead of string.EndsWith.
This commit is contained in:
@@ -94,8 +94,7 @@ namespace GameRes.Formats.Elf
|
||||
public override Stream OpenEntry (ArcFile arc, Entry entry)
|
||||
{
|
||||
var input = arc.File.CreateStream (entry.Offset, entry.Size);
|
||||
if (entry.Name.EndsWith (".mes", StringComparison.InvariantCultureIgnoreCase)
|
||||
|| entry.Name.EndsWith (".lib", StringComparison.InvariantCultureIgnoreCase))
|
||||
if (entry.Name.HasAnyOfExtensions ("mes", "lib"))
|
||||
return new LzssStream (input);
|
||||
return input;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace GameRes.Formats.Elf
|
||||
|
||||
public override ArcFile TryOpen (ArcView file)
|
||||
{
|
||||
if (!file.Name.EndsWith (".vol", StringComparison.InvariantCultureIgnoreCase))
|
||||
if (!file.Name.HasExtension (".vol"))
|
||||
return null;
|
||||
uint first_offset = file.View.ReadUInt32 (0);
|
||||
if (first_offset < 0x10 || 0 != (first_offset & 0xF) || first_offset >= file.MaxOffset)
|
||||
|
||||
Reference in New Issue
Block a user