From 7c3145633b7a2d621d77dec42567dacf7116bdb7 Mon Sep 17 00:00:00 2001 From: Ming-Hung Tsai Date: Mon, 10 Aug 2020 03:14:14 +0800 Subject: [PATCH] [space-maps/core] Fix the search start position --- persistent-data/space-maps/core.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/persistent-data/space-maps/core.cc b/persistent-data/space-maps/core.cc index 4251ef6..a79731e 100644 --- a/persistent-data/space-maps/core.cc +++ b/persistent-data/space-maps/core.cc @@ -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;