Signed-off-by: Ilsoo Byun <ilsoobyun@linecorp.com>
map<string, bufferlist> updates;
uint32_t count = 0;
+ int pos = -1;
while (count < num_entries && !candidates.empty()) {
r = 0;
// select the next one
- int pos = candidates.begin()->second;
+ pos = candidates.begin()->second;
const string& name = vcurrents[pos]->first;
struct rgw_bucket_dir_entry& dirent = vcurrents[pos]->second;
count << ", which is truncated" << dendl;
}
- if (!m.empty()) {
- *last_entry = m.rbegin()->first;
- }
+ if (pos >= 0)
+ *last_entry = std::move((--vcurrents[pos])->first);
return 0;
}