Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bab2min committed May 1, 2024
1 parent 37bfa60 commit e506efb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Kiwi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,16 +898,18 @@ namespace kiwi
{
ret.clear();
auto* cur = first;
for (size_t i = 0; i < nodes.size() && cur != last; ++i)
for (size_t i = 0; i < nodes.size(); ++i)
{
while (cur != last && nodes[i].startPos >= cur->end) ++cur;
if (cur == last) break;

if (cur->begin <= nodes[i].startPos && nodes[i].endPos <= cur->end)
{
ret.emplace_back(cur - first);
}
else
{
ret.emplace_back(-1);
if (nodes[i].startPos >= cur->end) ++cur;
}
}
ret.resize(nodes.size(), -1);
Expand Down

0 comments on commit e506efb

Please sign in to comment.