Fixed GetText to pleasure the unit test

Former-commit-id: c05337562c
This commit is contained in:
Jonas Kamsker 2022-01-12 00:31:47 +01:00 committed by GitHub
parent dd2bfac840
commit 0dd07055d8

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);
} }