From 1b4324579ebaa062be62ed3c46b1707f9d043e77 Mon Sep 17 00:00:00 2001 From: "ivandroflygit config --global user.email ivandrofly@gmail.comgit config --global user.name ivandrofly" Date: Sat, 26 Dec 2015 23:06:04 +0000 Subject: [PATCH 1/3] Simplify member access --- libse/HtmlUtil.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libse/HtmlUtil.cs b/libse/HtmlUtil.cs index 4e6b3ca65..eadc01bdb 100644 --- a/libse/HtmlUtil.cs +++ b/libse/HtmlUtil.cs @@ -534,7 +534,7 @@ namespace Nikse.SubtitleEdit.Core if (italicBeginTagCount == 0 && italicEndTagCount == 1) { - var cleanText = HtmlUtil.RemoveOpenCloseTags(text, HtmlUtil.TagItalic, HtmlUtil.TagBold, HtmlUtil.TagUnderline, HtmlUtil.TagCyrillicI); + var cleanText = RemoveOpenCloseTags(text, TagItalic, TagBold, TagUnderline, TagCyrillicI); bool isFixed = false; // Foo. From faceafe75c2331e4f531e1abf3bee8b20642955d Mon Sep 17 00:00:00 2001 From: "ivandroflygit config --global user.email ivandrofly@gmail.comgit config --global user.name ivandrofly" Date: Sat, 26 Dec 2015 23:47:06 +0000 Subject: [PATCH 2/3] Use already defined const for 'BaseUnit' --- libse/Subtitle.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libse/Subtitle.cs b/libse/Subtitle.cs index 8a9821d51..39c2d312b 100644 --- a/libse/Subtitle.cs +++ b/libse/Subtitle.cs @@ -429,7 +429,7 @@ namespace Nikse.SubtitleEdit.Core /// public int GetIndex(double seconds) { - var totalMilliseconds = seconds * 1000.0; + var totalMilliseconds = seconds * TimeCode.BaseUnit; for (int i = 0; i < Paragraphs.Count; i++) { var p = Paragraphs[i]; From 5af9fb605c1a2db55fd751dd5ebaccf6592d726d Mon Sep 17 00:00:00 2001 From: "ivandroflygit config --global user.email ivandrofly@gmail.comgit config --global user.name ivandrofly" Date: Sat, 26 Dec 2015 23:47:25 +0000 Subject: [PATCH 3/3] Cleanup + Refactor (Utilities.cs) --- libse/Utilities.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libse/Utilities.cs b/libse/Utilities.cs index 5acb6b8a4..9f6c8ae50 100644 --- a/libse/Utilities.cs +++ b/libse/Utilities.cs @@ -1240,8 +1240,6 @@ namespace Nikse.SubtitleEdit.Core return Uri.UnescapeDataString(text); } - - public static string FixEnglishTextInRightToLeftLanguage(string text, string reverseChars) { var sb = new StringBuilder(); @@ -1657,10 +1655,10 @@ namespace Nikse.SubtitleEdit.Core private static int FindNext(string s, string[] parts, int startIndex) { - for (int i = startIndex; i < parts.Length; i++) + for (; startIndex < parts.Length; startIndex++) { - if (s == parts[i]) - return i; + if (s == parts[startIndex]) + return startIndex; } return int.MaxValue; }