Compare commits
No commits in common. "5c85ef13d45639af75830b63d1126a28124ce83f" and "50aeb4281873f07977787f3ca5f0ab313b69715c" have entirely different histories.
5c85ef13d4
...
50aeb42818
@ -27,7 +27,7 @@ public:
|
|||||||
// compute [first; last( iterators for sub-range
|
// compute [first; last( iterators for sub-range
|
||||||
std::size_t size = bucketSize + remains;
|
std::size_t size = bucketSize + remains;
|
||||||
Iterator first = begin + offset;
|
Iterator first = begin + offset;
|
||||||
Iterator last = begin + offset + size;
|
Iterator last = first + bucketSize + remains;
|
||||||
|
|
||||||
// add appropriate search job
|
// add appropriate search job
|
||||||
jobList_.push_back(SearchJob<Iterator>(first, last, pattern));
|
jobList_.push_back(SearchJob<Iterator>(first, last, pattern));
|
||||||
@ -60,7 +60,7 @@ public:
|
|||||||
th.join();
|
th.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
// collect the results
|
// collec the results
|
||||||
for (SearchJob<Iterator>& job : jobList_)
|
for (SearchJob<Iterator>& job : jobList_)
|
||||||
{
|
{
|
||||||
result_.insert(result_.end(), job.get_result().begin(), job.get_result().end());
|
result_.insert(result_.end(), job.get_result().begin(), job.get_result().end());
|
||||||
|
|||||||
@ -44,9 +44,9 @@ public:
|
|||||||
private:
|
private:
|
||||||
// pattern to search for
|
// pattern to search for
|
||||||
std::string pattern_;
|
std::string pattern_;
|
||||||
// start of search range
|
// first valid index
|
||||||
Iterator begin_;
|
Iterator begin_;
|
||||||
// end of search range
|
// last valid index
|
||||||
Iterator end_;
|
Iterator end_;
|
||||||
// result of the search
|
// result of the search
|
||||||
ResultList result_;
|
ResultList result_;
|
||||||
|
|||||||
2
main.cpp
2
main.cpp
@ -71,7 +71,7 @@ int main()
|
|||||||
|
|
||||||
// TODO add validation of results
|
// TODO add validation of results
|
||||||
// TODO brush up output
|
// TODO brush up output
|
||||||
// TODO command line args for workerCount, test-pattern generation, search pattern ?
|
// TODO command line args for workerCount, test-pattern generation ?
|
||||||
|
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user