Minor refact (Logic/Settings)

This commit is contained in:
Waldi Ravens 2015-04-05 15:53:48 +02:00
parent 09270c84a4
commit f68f17da45

View File

@ -2861,13 +2861,13 @@ namespace Nikse.SubtitleEdit.Logic
{
const int maximumFindHistoryItems = 10;
textWriter.WriteStartElement("FindHistory", "");
for (int index = 0; index < settings.Tools.FindHistory.Count; index++)
int maxIndex = settings.Tools.FindHistory.Count;
if (maxIndex > maximumFindHistoryItems)
maxIndex = maximumFindHistoryItems;
for (int index = 0; index < maxIndex; index++)
{
if (index < maximumFindHistoryItems)
{
var text = settings.Tools.FindHistory[index];
textWriter.WriteElementString("Text", text);
}
var text = settings.Tools.FindHistory[index];
textWriter.WriteElementString("Text", text);
}
textWriter.WriteEndElement();
}