From 1ffa5bc97a7685b9c2d5cdad6be145e6ded41a3e Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 6 Jun 2020 13:21:10 -0500 Subject: [PATCH] simply some movie code a bit --- .../movie/bk2/Bk2Movie.InputLog.cs | 28 ++++--------------- .../movie/tasproj/TasMovie.cs | 9 ++---- 2 files changed, 8 insertions(+), 29 deletions(-) diff --git a/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs b/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs index 0755104ce3..572d5c4922 100644 --- a/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs +++ b/src/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Globalization; using System.IO; using BizHawk.Common; @@ -48,14 +47,9 @@ namespace BizHawk.Client.Common } Log.Clear(); - while (true) + string line; + while ((line = reader.ReadLine()) != null) { - var line = reader.ReadLine(); - if (string.IsNullOrEmpty(line)) - { - break; - } - if (line.Contains("Frame ")) { var strs = line.Split(' '); @@ -82,14 +76,9 @@ namespace BizHawk.Client.Common else { var i = 0; - while (true) + string line; + while ((line = reader.ReadLine()) != null) { - var line = reader.ReadLine(); - if (line == null) - { - break; - } - if (line.Contains("Frame ")) { var strs = line.Split(' '); @@ -153,14 +142,9 @@ namespace BizHawk.Client.Common errorMessage = ""; var newLog = new List(); var stateFrame = 0; - while (true) + string line; + while ((line = reader.ReadLine()) != null) { - var line = reader.ReadLine(); - if (line == null) - { - break; - } - if (line.Trim() == "") { continue; diff --git a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.cs b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.cs index fc4b81b994..cf04f59971 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/TasMovie.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/TasMovie.cs @@ -191,14 +191,9 @@ namespace BizHawk.Client.Common } int counter = 0; - while (true) + string line; + while ((line = reader.ReadLine()) != null) { - var line = reader.ReadLine(); - if (string.IsNullOrEmpty(line)) - { - break; - } - if (line.Contains("Frame ")) { var split = line.Split(' ');