A bit extra performance in last commit + updated change log

This commit is contained in:
Nikolaj Olsson 2016-11-25 20:00:16 +01:00
parent be82eb7375
commit c55e5ccd41
2 changed files with 22 additions and 19 deletions

View File

@ -9,6 +9,7 @@
* Updated Romanian translation - thx Mircea
* Updated Finnish translation - thx Teijo
* Updated French Translation - thx JM GBT
* Language auto-detect now includes Latvian and Lithuanian - thx rhazor
* FIXED:
* Fixed possible crash when generating scene changes - thx Leemet
* Fixed issues with moving rules in "Multiple replace" - thx kristiaanvk
@ -17,6 +18,11 @@
* Fixed possible crash in textbox with italic - thx ivandrofly
* Fixed bug in file naming after extracting sub from mkv - thx mzso
* Fixed bottom margin in image export of SSA/ASS - thx maddox
* "Find" always try to find the next occurrence - thx Boulder08
* Fixed "Remove text for HI" issue reagarding colons - thx Boulder08
* Fix "Fix missing spaces" issue regarding Finnish/Swedish colons - thx Boulder08
* Fix two issues with "Fix common errors" - thx Tronar
* OCR fix rules: fix for weird Unicode comma (#x201A) - thx djc
3.5 (26th October 2016)

View File

@ -1207,8 +1207,7 @@ namespace Nikse.SubtitleEdit.Core
{
return s;
}
char[] chars = new char[len];
// O(n)
var chars = new char[len];
for (int i = 0; i < len; i++)
{
chars[i] = s[len - i - 1];
@ -1223,26 +1222,24 @@ namespace Nikse.SubtitleEdit.Core
return s;
}
int len = s.Length;
char[] chars = new char[len];
// O(n)
for (int i = len - 1; i >= 0; i--)
var chars = new char[len];
for (int i = 0; i < len; i++)
{
char ch = s[i];
if (ch == '(')
switch (ch)
{
ch = ')';
}
else if (ch == ')')
{
ch = '(';
}
else if (ch == '[')
{
ch = ']';
}
else if (ch == ']')
{
ch = '[';
case '(':
ch = ')';
break;
case ')':
ch = '(';
break;
case '[':
ch = ']';
break;
case ']':
ch = '[';
break;
}
chars[i] = ch;
}