diff options
author | Henning Baldersheim <balder@oath.com> | 2018-08-08 17:36:21 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-08-08 17:36:21 +0200 |
commit | add10dc664112b740183e2c25f3b890afb66c5ed (patch) | |
tree | 66ddee4e39fb8821e18a9854bb6e244e662be0bc | |
parent | 05e6caaadd289362269298876bbaa74cda1784a3 (diff) |
Adderss comments from @havardpe
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/matching/match_loop_communicator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_loop_communicator.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_loop_communicator.cpp index 86a220bb779..54cffce7f40 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_loop_communicator.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/match_loop_communicator.cpp @@ -47,7 +47,7 @@ MatchLoopCommunicator::SelectBest::mingle(Q & queue, F && accept) { uint32_t i = queue.front(); const Hit & hit = in(i)[_indexes[i]]; if (accept(hit.first)) { - out(i).emplace_back(hit); + out(i).push_back(hit); ++picked; } if (in(i).size() > ++_indexes[i]) { @@ -64,9 +64,9 @@ MatchLoopCommunicator::SelectBest::mingle() vespalib::PriorityQueue<uint32_t, SelectCmp> queue(SelectCmp(*this)); for (size_t i = 0; i < size(); ++i) { if (!in(i).empty()) { - queue.push(i); - out(i).reserve(in(i).size()); + out(i).reserve(std::min(topN, in(i).size())); _indexes[i] = 0; + queue.push(i); } } if (_diversifier) { |