From 7314cf91921b13e1234dab22447db897aa994ef7 Mon Sep 17 00:00:00 2001 From: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com> Date: Fri, 29 Oct 2021 22:01:57 -0700 Subject: [PATCH] compress datetime comparision, make default initial time consistent with other cores --- .../Nintendo/NDS/MelonDS.ISettable.cs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.ISettable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.ISettable.cs index b077eda597..873e1b6fe9 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.ISettable.cs @@ -90,27 +90,12 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS [DisplayName("Initial Time")] [Description("Initial time of emulation.")] - [DefaultValue(typeof(DateTime), "2000-01-01")] + [DefaultValue(typeof(DateTime), "2010-01-01")] [TypeConverter(typeof(BizDateTimeConverter))] public DateTime InitialTime { get => _initaltime; - set - { - if (DateTime.Compare(minDate, value) > 0) - { - _initaltime = minDate; - } - else if (DateTime.Compare(maxDate, value) < 0) - { - _initaltime = maxDate; - } - else - { - _initaltime = value; - } - - } + set => _initaltime = value < minDate ? minDate : (value > maxDate ? maxDate : value); } [DisplayName("Use Real Time")]