move back AMAP

This commit is contained in:
Symious
2025-03-20 23:44:41 +08:00
parent b22f7153cc
commit c712ce1480

View File

@@ -32,10 +32,11 @@ struct AvailSlots {
std::lock_guard lock(mutex); std::lock_guard lock(mutex);
if (idx == nextAvail - 1) { if (idx == nextAvail - 1) {
while (free.find(--nextAvail) != free.end()) { nextAvail--;
// move back next avail as much as possible while (free.find(nextAvail - 1) != free.end()) {
; // move back next avail as much as possible
} free.erase(--nextAvail);
}
} else { } else {
free.insert(idx); free.insert(idx);
} }