Skip to content

Commit

Permalink
Simplify parsing of --dump-frames flag
Browse files Browse the repository at this point in the history
YoshiRulz committed Jun 11, 2024
1 parent 044729c commit cbf1bc6
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/BizHawk.Client.Common/ArgParser.cs
Original file line number Diff line number Diff line change
@@ -84,15 +84,10 @@ public static void ParseArguments(out ParsedCLIFlags parsed, string[] args)
else if (argDowncased.StartsWithOrdinal("--dump-frames="))
{
string list = argDowncased.Substring(argDowncased.IndexOf('=') + 1);
string[] items = list.Split(',');
currAviWriterFrameList = new HashSet<int>();
foreach (string item in items)
{
currAviWriterFrameList.Add(int.Parse(item));
}

currAviWriterFrameList = new();
currAviWriterFrameList.AddRange(list.Split(',').Select(int.Parse));
// automatically set dump length to maximum frame
autoDumpLength = currAviWriterFrameList.Order().Last();
autoDumpLength = currAviWriterFrameList.Max();
}
else if (argDowncased.StartsWithOrdinal("--version"))
{

0 comments on commit cbf1bc6

Please sign in to comment.