[internal] - cache char array global

This commit is contained in:
ivandrofly 2015-09-06 20:07:00 +01:00
parent 3366abdb44
commit 0e698216c1

View File

@ -177,6 +177,7 @@ namespace Nikse.SubtitleEdit.Core
}
}
private static readonly char[] ExpectedCharsArray = { '.', '!', '?', ':', ';', ')', ']', '}', '(', '[', '{' };
public void FixCasing(List<string> namesEtc, bool changeNameCases, bool makeUppercaseAfterBreak, bool checkLastLine, string lastLine)
{
var replaceIds = new List<string>();
@ -212,7 +213,7 @@ namespace Nikse.SubtitleEdit.Core
}
}
if (makeUppercaseAfterBreak && StrippedText.Contains(new[] { '.', '!', '?', ':', ';', ')', ']', '}', '(', '[', '{' }))
if (makeUppercaseAfterBreak && StrippedText.Contains(ExpectedCharsArray))
{
const string breakAfterChars = @".!?:;)]}([{";
const string ExpectedChars = "\"`´'()<>!?.- \r\n";