logic: reduce copies of intermediate storage data when creating shared memory representation

This commit is contained in:
mlangkabel
2018-08-10 16:19:45 +02:00
parent 5ace9e080f
commit 195f5893c9
3 changed files with 20 additions and 17 deletions
+4 -1
View File
@@ -508,12 +508,14 @@ void Project::buildIndex(const RefreshInfo& info, std::shared_ptr<DialogView> di
)
)
);
// add task for injecting the intermediate storages into the persistent storage
taskParallelIndexing->addTask(
std::make_shared<TaskGroupSequence>()->addChildTasks(
// block until there are indexers running
std::make_shared<TaskDecoratorRepeat>(TaskDecoratorRepeat::CONDITION_WHILE_SUCCESS, Task::STATE_SUCCESS)->addChildTask(
std::make_shared<TaskReturnSuccessWhile<int>>("indexer_count", TaskReturnSuccessWhile<int>::CONDITION_EQUALS, 0)
),
),
std::make_shared<TaskDecoratorRepeat>(TaskDecoratorRepeat::CONDITION_WHILE_SUCCESS, Task::STATE_SUCCESS)->addChildTask(
std::make_shared<TaskGroupSequence>()->addChildTasks(
// stopping when indexer count is zero, regardless wether there are still storages left to insert.
@@ -527,6 +529,7 @@ void Project::buildIndex(const RefreshInfo& info, std::shared_ptr<DialogView> di
)
)
);
// add task that notifies the user of what's going on
taskSequential->addTask( // we don't need to hide this dialog again, because it's overridden by other dialogs later on.
std::make_shared<TaskLambda>([dialogView]() {