always forget that linq First() accepts delegate.

This commit is contained in:
morkt 2016-03-07 19:07:16 +04:00
parent 9beff31fee
commit 977d4f215f
3 changed files with 3 additions and 3 deletions

View File

@ -78,7 +78,7 @@ namespace GameRes.Formats.KiriKiri
public override void Init (ArcFile arc)
{
var list_bin = arc.Dir.Where (e => e.Name == "plugin/list.bin").FirstOrDefault() as Xp3Entry;
var list_bin = arc.Dir.FirstOrDefault (e => e.Name == "plugin/list.bin") as Xp3Entry;
if (null == list_bin || list_bin.UnpackedSize <= 0x30)
return;
var bin = new byte[list_bin.UnpackedSize];

View File

@ -290,7 +290,7 @@ namespace GameRes.Formats.ShiinaRio // 椎名里緒
static EncryptionScheme GetScheme (string scheme)
{
return Decoder.KnownSchemes.Where (s => s.Name == scheme).FirstOrDefault();
return Decoder.KnownSchemes.FirstOrDefault (s => s.Name == scheme);
}
}

View File

@ -658,7 +658,7 @@ namespace GARbro.GUI
items = items.Skip (start_index).Concat (items.Take (start_index));
}
string input = m_current_input.Phrase.ToString();
var matched = items.Where (e => e.Name.StartsWith (input, StringIgnoreCase)).FirstOrDefault();
var matched = items.FirstOrDefault (e => e.Name.StartsWith (input, StringIgnoreCase));
if (null != matched)
lv_SelectItem (matched);
else