From 5c48cb96fd72a8b5ff9fdae1455d9ce3388cdd35 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Sat, 30 Jul 2022 07:49:06 +1000 Subject: [PATCH] When starting new `.tasproj` from SaveRAM, don't clone array twice --- .../tools/TAStudio/TAStudio.MenuItems.cs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index 13bb02afae..a9f66c55f4 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -53,18 +53,11 @@ namespace BizHawk.Client.EmuHawk { if (AskSaveChanges()) { - if (SaveRamEmulator.CloneSaveRam() != null) - { - GoToFrame(TasView.AnyRowsSelected ? TasView.FirstSelectedRowIndex : 0); - var newProject = CurrentTasMovie.ConvertToSaveRamAnchoredMovie( - SaveRamEmulator.CloneSaveRam()); - MainForm.PauseEmulator(); - LoadFile(new FileInfo(newProject.Filename), true); - } - else - { - throw new Exception("No SaveRam"); - } + var saveRam = SaveRamEmulator?.CloneSaveRam() ?? throw new Exception("No SaveRam"); + GoToFrame(TasView.AnyRowsSelected ? TasView.FirstSelectedRowIndex : 0); + var newProject = CurrentTasMovie.ConvertToSaveRamAnchoredMovie(saveRam); + MainForm.PauseEmulator(); + LoadFile(new FileInfo(newProject.Filename), true); } }