[SubtitleFormats] - clear stringbuilder instead re-instantiating.

This commit is contained in:
Ivandro Ismael 2016-08-10 03:45:06 +01:00
parent 4976f33026
commit 518ccaeea2
No known key found for this signature in database
GPG Key ID: A8832757DEFB7EDC
4 changed files with 4 additions and 4 deletions

View File

@ -102,7 +102,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
p.Text = sb.ToString().Trim();
subtitle.Paragraphs.Add(p);
}
sb = new StringBuilder();
sb.Clear();
string[] arr = s.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
if (arr.Length == 3)
p = new Paragraph(DecodeTimeCode(arr[1]), DecodeTimeCode(arr[2]), string.Empty);

View File

@ -79,7 +79,7 @@ NOTE=
p.Text = sb.ToString().Trim();
subtitle.Paragraphs.Add(p);
}
sb = new StringBuilder();
sb.Clear();
string[] arr = s.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
if (arr.Length == 2)
{

View File

@ -109,7 +109,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
p.Text = sb.ToString().Trim();
subtitle.Paragraphs.Add(p);
}
sb = new StringBuilder();
sb.Clear();
string[] arr = s.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
char[] splitChars = { ':', ';', ',', '.' };
if (arr.Length == 3)

View File

@ -73,7 +73,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
p.Text = sb.ToString().Trim();
subtitle.Paragraphs.Add(p);
}
sb = new StringBuilder();
sb.Clear();
string[] arr = s.Split('\t');
if (arr.Length == 2)
p = new Paragraph(DecodeTimeCodeFrames(arr[0], splitChars), DecodeTimeCodeFrames(arr[1], splitChars), string.Empty);