Skip to content

Commit

Permalink
Merge pull request ceph#62 from dalgaaf/wip-da-sca-cppcheck-performan…
Browse files Browse the repository at this point in the history
…ce-3

More performance patches 

Reviewed-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Feb 16, 2013
2 parents ae0c2bb + 29b4466 commit c45fbc7
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/ceph_authtool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int main(int argc, const char **argv)
!add_key.empty() ||
list ||
!caps_fn.empty() ||
caps.size() ||
!caps.empty() ||
set_auid ||
print_key ||
create_keyring ||
Expand Down Expand Up @@ -234,7 +234,7 @@ int main(int argc, const char **argv)
keyring.set_caps(ename, caps);
modified = true;
}
if (caps.size()) {
if (!caps.empty()) {
keyring.set_caps(ename, caps);
modified = true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/client/Client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3646,7 +3646,7 @@ void Client::unmount()
}

// wait for sessions to close
while (mds_sessions.size()) {
while (!mds_sessions.empty()) {
ldout(cct, 2) << "waiting for " << mds_sessions.size() << " mds sessions to close" << dendl;
mount_cond.Wait(client_lock);
}
Expand Down Expand Up @@ -7486,7 +7486,7 @@ int Client::get_file_stripe_address(int fd, loff_t offset, vector<entity_addr_t>
pg_t pg = osdmap->object_locator_to_pg(extents[0].oid, extents[0].oloc);
vector<int> osds;
osdmap->pg_to_acting_osds(pg, osds);
if (!osds.size())
if (osds.empty())
return -EINVAL;

for (unsigned i = 0; i < osds.size(); i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/client/SyntheticClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2703,7 +2703,7 @@ int SyntheticClient::random_walk(int num_req)
}

// descend?
if (.9*roll_die(::pow((double).9,(double)cwd.depth())) && subdirs.size()) {
if (.9*roll_die(::pow((double).9,(double)cwd.depth())) && !subdirs.empty()) {
string s = get_random_subdir();
cwd.push_dentry( s );
dout(DBL) << "cd " << s << " -> " << cwd << dendl;
Expand Down
2 changes: 1 addition & 1 deletion src/cls/lock/cls_lock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static int lock_obj(cls_method_context_t hctx,
}
}

if (lockers.size()) {
if (!lockers.empty()) {
if (exclusive) {
CLS_LOG(20, "could not exclusive-lock object, already locked");
return -EBUSY;
Expand Down
2 changes: 1 addition & 1 deletion src/mds/CDentry.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class CDentry : public MDSCacheObject, public LRUObject {
bool is_projected() { return projected.size(); }

linkage_t *get_projected_linkage() {
if (projected.size())
if (!projected.empty())
return &projected.back();
return &linkage;
}
Expand Down
2 changes: 1 addition & 1 deletion src/mds/MDSMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ class MDSMap {
failed.empty();
}
bool is_stopped() {
return up.size() == 0;
return up.empty();
}

// inst
Expand Down

0 comments on commit c45fbc7

Please sign in to comment.