low hanging fruit speed up in inputlog loading using str[0] == c instead of str.StartsWith(c)

This commit is contained in:
adelikat 2023-05-22 12:50:30 -05:00
parent 681ef72cd5
commit 333ce98a71
4 changed files with 5 additions and 5 deletions

View File

@ -53,7 +53,7 @@ namespace BizHawk.Client.Common
string line; string line;
while ((line = reader.ReadLine()) != null) while ((line = reader.ReadLine()) != null)
{ {
if (line.StartsWith("|")) if (line[0] == '|')
{ {
Log.Add(line); Log.Add(line);
} }
@ -117,7 +117,7 @@ namespace BizHawk.Client.Common
string line; string line;
while ((line = reader.ReadLine()) != null) while ((line = reader.ReadLine()) != null)
{ {
if (line.StartsWith("|")) if (line[0] == '|')
{ {
newLog.Add(line); newLog.Add(line);
} }

View File

@ -62,7 +62,7 @@ namespace BizHawk.Client.Common
{ {
Comments.Add(line.Substring(8, line.Length - 8)); Comments.Add(line.Substring(8, line.Length - 8));
} }
else if (line.StartsWith("|")) else if (line[0] == '|')
{ {
return false; return false;
} }

View File

@ -124,7 +124,7 @@ namespace BizHawk.Client.Common
break; break;
} }
if (line.StartsWith("|")) if (line[0] == '|')
{ {
VerificationLog.Add(line); VerificationLog.Add(line);
} }

View File

@ -226,7 +226,7 @@ namespace BizHawk.Client.Common
string line; string line;
while ((line = reader.ReadLine()) != null) while ((line = reader.ReadLine()) != null)
{ {
if (line.StartsWith("|")) if (line[0] == '|')
{ {
newLog.Add(line); newLog.Add(line);
if (!timelineBranchFrame.HasValue && counter < Log.Count && line != Log[counter]) if (!timelineBranchFrame.HasValue && counter < Log.Count && line != Log[counter])