This makes the intent clear and avoids passing the output map to do the move.
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
* Move contents of m into another Map. Use that instead of
* encoding interval_set into bufferlist then decoding it back into Map.
*/
- void move_into(Map& other) {
- other = std::move(m);
+ Map detach() && {
+ return std::move(m);
}
private:
interval_set<uint64_t> m;
int r = _fiemap(c_, oid, offset, length, m);
if (r >= 0) {
- m.move_into(destmap);
+ destmap = std::move(m).detach();
}
return r;
}
interval_set<uint64_t> im(m);
auto r = store->readv(ch, ghobject_t(hoid), im, *bl, op_flags);
if (r >= 0) {
- im.move_into(m);
+ m = std::move(im).detach();
}
return r;
}