Fixed GetText to pleasure the unit test

This commit is contained in:
Jonas Kamsker 2022-01-12 00:31:47 +01:00 committed by GitHub
parent 1b2af5fd1f
commit c05337562c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,13 +23,19 @@ private FFMpegArguments() { }
private string GetText() private string GetText()
{ {
var sb = new StringBuilder(); var sb = new StringBuilder();
var appendSpace = false;
foreach (var arg in _globalArguments.Arguments.Concat(Arguments)) foreach (var arg in _globalArguments.Arguments.Concat(Arguments))
{ {
if (sb.Length != 0) if (appendSpace)
{ {
sb.Append(' '); sb.Append(' ');
} }
else
{
appendSpace = true;
}
sb.Append(arg is IDynamicArgument dynArg ? dynArg.GetText(sb) : arg.Text); sb.Append(arg is IDynamicArgument dynArg ? dynArg.GetText(sb) : arg.Text);
} }