logic: sort custom indexer commands by indexed file size and name

This commit is contained in:
mlangkabel
2019-05-21 17:23:03 +02:00
parent 0fb7fe719a
commit 4d6cb464c4
4 changed files with 52 additions and 43 deletions
@@ -16,6 +16,7 @@
#include "TextAccess.h"
#include "utility.h"
#include "utilityApp.h"
#include "utilityFile.h"
#include "utilityString.h"
TaskExecuteCustomCommands::TaskExecuteCustomCommands(
@@ -42,7 +43,7 @@ void TaskExecuteCustomCommands::doEnter(std::shared_ptr<Blackboard> blackboard)
if (m_indexerCommandProvider)
{
for (const FilePath& sourceFilePath : m_indexerCommandProvider->getAllSourceFilePaths())
for (const FilePath& sourceFilePath : utility::partitionFilePathsBySize(m_indexerCommandProvider->getAllSourceFilePaths(), 2))
{
if (std::shared_ptr<IndexerCommandCustom> indexerCommand =
std::dynamic_pointer_cast<IndexerCommandCustom>(m_indexerCommandProvider->consumeCommandForSourceFilePath(sourceFilePath)))
@@ -67,6 +68,9 @@ void TaskExecuteCustomCommands::doEnter(std::shared_ptr<Blackboard> blackboard)
}
}
}
// reverse because we pull elements from the back of these vectors
std::reverse(m_parallelCommands.begin(), m_parallelCommands.end());
std::reverse(m_serialCommands.begin(), m_serialCommands.end());
}
}