Skip to content

Commit

Permalink
tuned the speed of analyzing
Browse files Browse the repository at this point in the history
  • Loading branch information
bab2min committed Oct 30, 2023
1 parent a4a85c4 commit 8698de8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Kiwi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ namespace kiwi

if (ret.empty())
{
const size_t n = pathes.size();
const size_t n = min(pathes.size(), topN * 2);
ret.resize(n);
spStatesByRet.resize(n);
parentMap.resize(n);
Expand Down
1 change: 1 addition & 0 deletions src/PathEvaluator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,7 @@ namespace kiwi
{
return a.score > b.score;
});
if (ret.size() > topN * 2) ret.erase(ret.begin() + topN * 2, ret.end());
return ret;
}
}

0 comments on commit 8698de8

Please sign in to comment.