Skip to content

Commit

Permalink
fix: pfld results uses forward list
Browse files Browse the repository at this point in the history
  • Loading branch information
nullptr authored Dec 7, 2024
1 parent 6d0cf9d commit 3eddbc4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/SSCMA_Micro_Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,8 @@ SSCMAMicroCore::Expected SSCMAMicroCore::invoke(const Frame& frame, const Invoke
}
auto results = algorithm->getResults();
if (_config.invoke_config && _config.invoke_config->top_k > 0) {
std::sort(results.begin(), results.end(), [](const ma_point_t& a, const ma_point_t& b) { return a.score > b.score; });
results.resize(std::min(results.size(), static_cast<size_t>(_config.invoke_config->top_k)));
results.shrink_to_fit();
results.sort([](const ma_point_t& a, const ma_point_t& b) { return a.score < b.score; });
results.resize(_config.invoke_config->top_k);
}
std::vector<SSCMAMicroCore::Point> points;
for (const auto& result : results) {
Expand Down

0 comments on commit 3eddbc4

Please sign in to comment.