From b37a395f79fef97be32a018260895a0e74d58728 Mon Sep 17 00:00:00 2001 From: ivandrofly Date: Wed, 2 Sep 2015 07:24:17 +0100 Subject: [PATCH] [OcrFixReplaceList] - minor refact --- libse/Dictionaries/OcrFixReplaceList.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libse/Dictionaries/OcrFixReplaceList.cs b/libse/Dictionaries/OcrFixReplaceList.cs index 5efc4b8b8..16a5a5ec0 100644 --- a/libse/Dictionaries/OcrFixReplaceList.cs +++ b/libse/Dictionaries/OcrFixReplaceList.cs @@ -273,7 +273,7 @@ namespace Nikse.SubtitleEdit.Core.Dictionaries if (Configuration.Settings.Tools.OcrFixUseHardcodedRules) { word = word.Replace("fi", "fi"); - word = word.Replace("ν", "v"); // NOTE: first 'v' is a special unicode character!!!! + word = word.Replace('ν', 'v'); // NOTE: first 'v' is a special unicode character!!!! if (word.Contains('’')) word = word.Replace('’', '\''); @@ -544,12 +544,13 @@ namespace Nikse.SubtitleEdit.Core.Dictionaries match = RegExTime1.Match(word); } + const string expectedDigits = "123456789"; match = RegExTime2.Match(word); while (match.Success) { if (word[match.Index] == '0') { - if (match.Index == 0 || !@"123456789".Contains(word[match.Index - 1])) + if (match.Index == 0 || !expectedDigits.Contains(word[match.Index - 1])) { string oldText = word; word = word.Substring(0, match.Index) + "o";