Signed-off-by: Ilsoo Byun <ilsoobyun@linecorp.com>
(cherry picked from commit
2eaac132d491ef3c6f8cb50c34fc67f56e006c07)
Conflicts:
src/rgw/rgw_rados.cc
- comment is slightly different in nautilus
- nautilus does not have "if (*is_truncated && count < num_entries)"
conditional block
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;
}