Removed always-true test (Forms/MultipleReplace)

This commit is contained in:
Waldi Ravens 2015-02-24 03:55:45 +01:00
parent 395d5655a3
commit 2baf6d9edb

View File

@ -193,11 +193,7 @@ namespace Nikse.SubtitleEdit.Forms
int index = newText.IndexOf(findWhat, StringComparison.OrdinalIgnoreCase); int index = newText.IndexOf(findWhat, StringComparison.OrdinalIgnoreCase);
while (index >= 0) while (index >= 0)
{ {
if (index < newText.Length) newText = newText.Substring(0, index) + replaceWith + newText.Remove(0, index + findWhat.Length);
newText = newText.Substring(0, index) + replaceWith + newText.Substring(index + findWhat.Length);
else
newText = newText.Substring(0, index) + replaceWith;
hit = true; hit = true;
index = newText.IndexOf(findWhat, index + replaceWith.Length, StringComparison.OrdinalIgnoreCase); index = newText.IndexOf(findWhat, index + replaceWith.Length, StringComparison.OrdinalIgnoreCase);
} }