mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-15 00:37:11 +00:00
Simplify expression
ternary with a null check and long method signature is pretty ugly
This commit is contained in:
parent
54ba9a0312
commit
a39f917f84
1 changed files with 3 additions and 3 deletions
|
@ -796,9 +796,9 @@ namespace PKHeX.Core
|
|||
/// <returns>Format hint that the file is.</returns>
|
||||
public static int GetPKMFormatFromExtension(string ext, int prefer)
|
||||
{
|
||||
return ext?.Length > 1
|
||||
? GetPKMFormatFromExtension(ext[ext.Length - 1], prefer)
|
||||
: prefer;
|
||||
if (string.IsNullOrEmpty(ext))
|
||||
return prefer;
|
||||
return GetPKMFormatFromExtension(ext[ext.Length - 1], prefer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in a new issue