diff --git a/src/best/BestResults.cpp b/src/best/BestResults.cpp index 56902b7..208fef6 100644 --- a/src/best/BestResults.cpp +++ b/src/best/BestResults.cpp @@ -132,6 +132,7 @@ namespace platform { for (const auto& dataset_ : table.items()) { datasets.push_back(dataset_.key()); } + std::stable_sort(datasets.begin(), datasets.end()); maxDatasetName = (*max_element(datasets.begin(), datasets.end(), [](const std::string& a, const std::string& b) { return a.size() < b.size(); })).size(); maxDatasetName = std::max(7, maxDatasetName); return datasets; diff --git a/src/common/Datasets.cpp b/src/common/Datasets.cpp index ca155b3..bfbc447 100644 --- a/src/common/Datasets.cpp +++ b/src/common/Datasets.cpp @@ -1,4 +1,5 @@ #include +#include #include "Datasets.h" #include @@ -24,10 +25,15 @@ namespace platform { throw std::invalid_argument("Unable to open catalog file. [" + path + "all.txt" + "]"); } std::string line; + std::vector sorted_lines; while (getline(catalog, line)) { if (line.empty() || line[0] == '#') { continue; } + sorted_lines.push_back(line); + } + std::stable_sort(sorted_lines.begin(), sorted_lines.end()); + for (const auto& line : sorted_lines) { std::vector tokens = split(line, ';'); std::string name = tokens[0]; std::string className;