[space-maps/core] Fix the search start position

This commit is contained in:
Ming-Hung Tsai 2020-08-10 03:14:14 +08:00
parent 2d9eaa1c56
commit 7c3145633b
1 changed files with 4 additions and 2 deletions

View File

@ -190,10 +190,12 @@ namespace {
set_bits_(b, c);
}
if (old_c == 0 && c > 0)
if (old_c == 0 && c > 0) {
nr_free_--;
if (b == search_start_)
search_start_++;
else if (old_c > 0 && c == 0) {
} else if (old_c > 0 && c == 0) {
if (b < search_start_)
search_start_ = b;