From: Haomai Wang Date: Tue, 16 Sep 2014 06:59:18 +0000 (+0800) Subject: KeyValueStore: Reduce redundant "make_pair" X-Git-Tag: v0.88~139^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=457790da6e21614fc80fc31bf3447e90095a15ac;p=ceph.git KeyValueStore: Reduce redundant "make_pair" Signed-off-by: Haomai Wang --- diff --git a/src/os/KeyValueStore.cc b/src/os/KeyValueStore.cc index af282d3fd1ec..fdce0213c68c 100644 --- a/src/os/KeyValueStore.cc +++ b/src/os/KeyValueStore.cc @@ -295,10 +295,11 @@ int KeyValueStore::BufferTransaction::lookup_cached_header( StripObjectMap::StripObjectHeaderRef *strip_header, bool create_if_missing) { + uniq_id uid = make_pair(cid, oid); StripObjectMap::StripObjectHeaderRef header; int r = 0; - StripHeaderMap::iterator it = strip_headers.find(make_pair(cid, oid)); + StripHeaderMap::iterator it = strip_headers.find(uid); if (it != strip_headers.end()) { if (!it->second->deleted) { @@ -325,9 +326,9 @@ int KeyValueStore::BufferTransaction::lookup_cached_header( return r; } - strip_headers[make_pair(cid, oid)] = header; + strip_headers[uid] = header; if (strip_header) - *strip_header = strip_headers[make_pair(cid, oid)]; + *strip_header = header; return r; }