mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-25 07:25:40 -05:00
Simplify expression
ternary with a null check and long method signature is pretty ugly
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user