Reduce memory allocation

This commit is contained in:
ivandroly 2015-06-30 04:11:04 +00:00
parent 0c10e58c12
commit 57a0f2a50d
2 changed files with 2 additions and 3 deletions

View File

@ -300,8 +300,7 @@ namespace Nikse.SubtitleEdit.Logic.Dictionaries
if (word.Contains('¤')) if (word.Contains('¤'))
{ {
var regex = new Regex("[A-ZÆØÅÄÖÉÈÀÙÂÊÎÔÛËÏa-zæøåäöéèàùâêîôûëï]¤"); if (Regex.IsMatch(word, "[A-ZÆØÅÄÖÉÈÀÙÂÊÎÔÛËÏa-zæøåäöéèàùâêîôûëï]¤"))
if (regex.IsMatch(word))
word = word.Replace('¤', 'o'); word = word.Replace('¤', 'o');
} }
} }

View File

@ -384,7 +384,7 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
} }
sb.Append(fixedWord); sb.Append(fixedWord);
lastWord = fixedWord; lastWord = fixedWord;
word = new StringBuilder(); word.Clear();
} }
sb.Append(text[i]); sb.Append(text[i]);
} }