wb: more robust side_actions_container::get_turn
the assumption (turn_beginnings_[num] == it) => (get_turn(it) == num) might be wrong in case that we have a turn with no actions, in which case turn_beginnings_ contains duplicates and we actually want the upper bound of (x <= it) in turn_beginnings_
This commit is contained in:
parent
9277a6cf53
commit
ba6495c96a
1 changed files with 1 additions and 3 deletions
|
@ -83,10 +83,8 @@ std::size_t side_actions_container::get_turn_impl(std::size_t begin, std::size_t
|
|||
std::size_t mid = (begin+end) / 2;
|
||||
if(it < turn_beginnings_[mid]) {
|
||||
return get_turn_impl(begin, mid, it);
|
||||
} else if(it > turn_beginnings_[mid]) {
|
||||
return get_turn_impl(mid, end, it);
|
||||
} else {
|
||||
return mid;
|
||||
return get_turn_impl(mid, end, it);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue