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('¤'))
{
var regex = new Regex("[A-ZÆØÅÄÖÉÈÀÙÂÊÎÔÛËÏa-zæøåäöéèàùâêîôûëï]¤");
if (regex.IsMatch(word))
if (Regex.IsMatch(word, "[A-ZÆØÅÄÖÉÈÀÙÂÊÎÔÛËÏa-zæøåäöéèàùâêîôûëï]¤"))
word = word.Replace('¤', 'o');
}
}

View File

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