feat: make bucket-finder default
This commit is contained in:
parent
06500fd69a
commit
8c9a1522a0
@ -28,12 +28,12 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
MainWindow::~MainWindow() { delete ui; }
|
||||
|
||||
void MainWindow::setupAlgorithmSelector() {
|
||||
search_algorithms_.appendRow(new QStandardItem("Bucket search"));
|
||||
search_algorithms_.appendRow(new QStandardItem("Linear search"));
|
||||
search_algorithms_.appendRow(new QStandardItem("Sorted linear search"));
|
||||
search_algorithms_.appendRow(new QStandardItem("Parallel search"));
|
||||
search_algorithms_.appendRow(new QStandardItem("Tree search"));
|
||||
search_algorithms_.appendRow(new QStandardItem("Grouped search"));
|
||||
search_algorithms_.appendRow(new QStandardItem("Bucket search"));
|
||||
}
|
||||
|
||||
void MainWindow::setupWordListSourceSelector() {
|
||||
@ -89,8 +89,8 @@ void MainWindow::search(const QString &search_term) {
|
||||
timer.stop();
|
||||
|
||||
std::stringstream status_message;
|
||||
status_message << "search took " << timer << ", found "
|
||||
<< std::distance(results.begin(), results.end()) << " results";
|
||||
status_message << "search took " << timer << ", found " << results.size()
|
||||
<< " result(s) in " << word_list_.size() << " words.";
|
||||
ui->mainStatusBar->showMessage(QString::fromStdString(status_message.str()));
|
||||
|
||||
showResults(results);
|
||||
@ -102,22 +102,22 @@ void MainWindow::createSelectedFinder() {
|
||||
switch (selectedFinder) {
|
||||
case 0:
|
||||
default:
|
||||
finder_ = std::make_unique<LinearFinder>(word_list_);
|
||||
finder_ = std::make_unique<BucketFinder>(word_list_);
|
||||
break;
|
||||
case 1:
|
||||
finder_ = std::make_unique<SortedLinearFinder>(word_list_);
|
||||
finder_ = std::make_unique<LinearFinder>(word_list_);
|
||||
break;
|
||||
case 2:
|
||||
finder_ = std::make_unique<ParallelFinder>(word_list_);
|
||||
finder_ = std::make_unique<SortedLinearFinder>(word_list_);
|
||||
break;
|
||||
case 3:
|
||||
finder_ = std::make_unique<TreeFinder>(word_list_);
|
||||
finder_ = std::make_unique<ParallelFinder>(word_list_);
|
||||
break;
|
||||
case 4:
|
||||
finder_ = std::make_unique<GroupedFinder>(word_list_);
|
||||
finder_ = std::make_unique<TreeFinder>(word_list_);
|
||||
break;
|
||||
case 5:
|
||||
finder_ = std::make_unique<BucketFinder>(word_list_);
|
||||
finder_ = std::make_unique<GroupedFinder>(word_list_);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user