pset.insert(acting[i]);
up++;
}
- if (!up && acting.size()) {
+ if (!up && !acting.empty()) {
// sucky. add down osds, even tho we can't reach them right now.
for (unsigned i=0; i<acting.size(); i++)
if (acting[i] != whoami)
dout(20) << "do_command tid " << tid << " " << cmd << dendl;
- if (cmd.size() == 0) {
+ if (cmd.empty()) {
ss << "no command given";
goto out;
}
<< (end-start) << " sec at " << prettybyte_t(rate) << "/sec";
}
- else if (cmd.size() >= 1 && cmd[0] == "flush_pg_stats") {
+ else if (!cmd.empty() && cmd[0] == "flush_pg_stats") {
flush_pg_stats();
}
object_info_t oi(bv);
t.collection_move(coll_t(pgid), coll_t(parentid), poid);
- if (oi.snaps.size()) {
+ if (!oi.snaps.empty()) {
snapid_t first = oi.snaps[0];
t.collection_move(coll_t(pgid, first), coll_t(parentid), poid);
if (oi.snaps.size() > 1) {
*/
if (!started && pg->have_unfound()) {
pg->discover_all_missing(*rctx.query_map);
- if (!rctx.query_map->size()) {
+ if (rctx.query_map->empty()) {
dout(10) << "do_recovery no luck, giving up on this pg for now" << dendl;
recovery_wq.lock();
recovery_wq._dequeue(pg);
same_interval_since = MAX(pg->info.history.same_interval_since,
same_interval_since);
pg->write_if_dirty(*rctx.transaction);
- if (split_pgs.size()) {
+ if (!split_pgs.empty()) {
rctx.on_applied->add(new C_CompleteSplits(this, split_pgs));
split_pgs.clear();
}