Todo: 10x speed-up open-file tracking.

When idle-timer fires for the Todo plug-in, this method gets hit. When
I have qtcreator.pro loaded, and 1 file open, and hit enter once, this
change reduces time spend in this method from 223ms to 22ms of UI
thread activity.

Change-Id: I76234601d39605a85e89700d18dd017ac1b8a902
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Erik Verbruggen
2013-04-10 16:12:39 +02:00
parent 7406761f8f
commit 269545bb35

View File

@@ -108,7 +108,7 @@ void TodoItemsProvider::createScanners()
void TodoItemsProvider::setItemsListWithinStartupProject() void TodoItemsProvider::setItemsListWithinStartupProject()
{ {
QHashIterator<QString, QList<TodoItem> > it(m_itemsHash); QHashIterator<QString, QList<TodoItem> > it(m_itemsHash);
QStringList fileNames = m_startupProject->files(ProjectExplorer::Project::ExcludeGeneratedFiles); QSet<QString> fileNames = QSet<QString>::fromList(m_startupProject->files(ProjectExplorer::Project::ExcludeGeneratedFiles));
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
if (fileNames.contains(it.key())) if (fileNames.contains(it.key()))