use HasExtension method instead of string.EndsWith.

This commit is contained in:
morkt
2017-04-10 23:15:13 +04:00
parent e0a5e95081
commit 31a01f2e5d
72 changed files with 105 additions and 114 deletions

View File

@@ -42,7 +42,7 @@ namespace GameRes.Formats.Propeller
public override ArcFile TryOpen (ArcView file)
{
if (!file.Name.EndsWith (".mgr", StringComparison.InvariantCultureIgnoreCase))
if (!file.Name.HasExtension (".mgr"))
return null;
int count = file.View.ReadInt16 (0);
if (count <= 0 || count >= 0x100)

View File

@@ -77,7 +77,7 @@ namespace GameRes.Formats.Propeller
public override Stream OpenEntry (ArcFile arc, Entry entry)
{
var input = arc.File.CreateStream (entry.Offset, entry.Size);
if (!entry.Name.EndsWith (".msc", StringComparison.InvariantCultureIgnoreCase)
if (!entry.Name.HasExtension (".msc")
|| 0x88 != input.PeekByte())
return input;
return new XoredStream (input, 0x88);