]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
KeyValueStore: Reduce redundant "make_pair" 2502/head
authorHaomai Wang <haomaiwang@gmail.com>
Tue, 16 Sep 2014 06:59:18 +0000 (14:59 +0800)
committerHaomai Wang <haomaiwang@gmail.com>
Tue, 16 Sep 2014 06:59:18 +0000 (14:59 +0800)
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
src/os/KeyValueStore.cc

index af282d3fd1ece8b883763c28c140f9da14205da0..fdce0213c68c99649d963aed43ba4c7991b8bbac 100644 (file)
@@ -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;
 }