mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 04:33:04 +01:00
[SubtitleFormats] - clear stringbuilder instead re-instantiating.
This commit is contained in:
parent
4976f33026
commit
518ccaeea2
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user