Remove duplicae null check, simplified state check
MODIFY
WalletWasabi.Gui/Converters/WindowStateAfterSartJsonConverter.cs
WalletWasabi.Gui/Converters/WindowStateAfterSartJsonConverter.cs
@@ -27,22 +27,11 @@ namespace WalletWasabi.Gui.Converters
return WindowState.Maximized;
}
- if (value is null)
- {
- return WindowState.Maximized;
- }
+ var windowStateString = value.Trim();
- string windowStateString = value.Trim();
- if (WindowState.Normal.ToString().Equals(windowStateString, StringComparison.OrdinalIgnoreCase)
- || "normal".Equals(windowStateString, StringComparison.OrdinalIgnoreCase)
- || "norm".Equals(windowStateString, StringComparison.OrdinalIgnoreCase))
- {
- return WindowState.Normal;
- }
- else
- {
- return WindowState.Maximized;
- }
+ return windowStateString.StartsWith("norm", StringComparison.OrdinalIgnoreCase)
+ ? WindowState.Normal
+ : WindowState.Maximized;
}
catch
{

Remove duplicae null check, simplified state check