From 422498c7fd08f59b4574e8c5974810bbb403979e Mon Sep 17 00:00:00 2001 From: tatiana-yan Date: Mon, 27 Apr 2020 13:34:54 +0300 Subject: [PATCH] [generator] Remove unused function. --- generator/feature_builder.hpp | 42 ----------------------------------- 1 file changed, 42 deletions(-) diff --git a/generator/feature_builder.hpp b/generator/feature_builder.hpp index 6f8cf78b1a..4ea65e1d65 100644 --- a/generator/feature_builder.hpp +++ b/generator/feature_builder.hpp @@ -304,48 +304,6 @@ void ForEachFeatureRawFormat(std::string const & filename, ToDo && toDo) } } -/// Parallel process features in features file. -template -void ForEachParallelFromDatRawFormat(size_t threadsCount, std::string const & filename, - ToDo && toDo) -{ - CHECK_GREATER_OR_EQUAL(threadsCount, 1, ()); - if (threadsCount == 1) - return ForEachFeatureRawFormat(filename, std::forward(toDo)); - - FileReader reader(filename); - ReaderSource src(reader); - // TryReadAndCheckVersion(src); - auto const fileSize = reader.Size(); - auto currPos = src.Pos(); - std::mutex readMutex; - auto concurrentProcessor = [&] { - for (;;) - { - FeatureBuilder fb; - uint64_t featurePos; - - { - std::lock_guard lock(readMutex); - - if (fileSize <= currPos) - break; - - ReadFromSourceRawFormat(src, fb); - featurePos = currPos; - currPos = src.Pos(); - } - - toDo(fb, featurePos); - } - }; - - std::vector workers; - for (size_t i = 0; i < threadsCount; ++i) - workers.emplace_back(concurrentProcessor); - for (auto & thread : workers) - thread.join(); -} template std::vector ReadAllDatRawFormat(std::string const & fileName) {