mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-09 04:24:36 -05:00
Simplify expression
ternary with a null check and long method signature is pretty ugly
This commit is contained in:
parent
54ba9a0312
commit
a39f917f84
|
|
@ -796,9 +796,9 @@ public static string[] GetPKMExtensions(int maxGeneration = Generation)
|
|||
/// <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 New Issue
Block a user