RemoveRecurring sohuld be much faster
Make robots for MediaWiki-powered sites!
Brought to you by:
code_driller
The current implementation for RemoveRecurring()
has cubic time complexity, which means it is unusable when you get to 10,000 pages or so.
Here's an alternate implementation:
public void RemoveRecurring()
{
HashSet<string> titles = new HashSet<string>();
for (int i = pages.Count - 1; i >= 0; i--)
{
if (titles.Contains(pages[i].title))
{
pages.RemoveAt(i);
}
else
{
titles.Add(pages[i].title);
}
}
}