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;
break;
}
}
- if (!m.empty())
- *last_entry = m.rbegin()->first;
+
+ if (pos >= 0)
+ *last_entry = std::move((--vcurrents[pos])->first);
return 0;
}