Use pattern matching to simplify some string comparisons

This commit is contained in:
YoshiRulz 2025-06-13 02:08:27 +10:00
parent 4ac8d55fb1
commit 3540f48847
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
3 changed files with 3 additions and 3 deletions

View File

@ -85,7 +85,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
cpu.SetCallbacks(ReadMemory, PeekMemory, PeekMemory, WriteMemory);
// set up differences between PAL and NTSC systems
if ((game.Region == "US" || game.Region == "EU-US" || game.Region == null) && !is_G7400)
if (!is_G7400 && game.Region is null or "US" or "EU-US")
{
is_pal = false;
pic_height = 240;

View File

@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
_disableExpansionSlot = _syncSettings.DisableExpansionSlot;
// Override the user's expansion slot setting if it is mentioned in the gamedb (it is mentioned but the game MUST have this setting or else not work
if (game.OptionValue("expansionpak") != null && game.OptionValue("expansionpak") == "1")
if (game.OptionValue("expansionpak") is "1")
{
_disableExpansionSlot = false;
IsOverridingUserExpansionSlotSetting = true;

View File

@ -297,7 +297,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
{
if (display == SmsSyncSettings.DisplayTypes.Ntsc) return DisplayType.NTSC;
if (display == SmsSyncSettings.DisplayTypes.Pal) return DisplayType.PAL;
if (region != null && region == "Europe") return DisplayType.PAL;
if (region is "Europe") return DisplayType.PAL;
return DisplayType.NTSC;
}